Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dummy CVS backend to recognize and skip CVS working directories #115

Merged
merged 5 commits into from
Apr 26, 2019
Merged

Add a dummy CVS backend to recognize and skip CVS working directories #115

merged 5 commits into from
Apr 26, 2019

Conversation

knu
Copy link
Contributor

@knu knu commented Feb 4, 2019

If you have a CVS working directory tree in ghq.root, ghq walks into it and never gets out until it traverses the whole tree.

CVS does not have a single URL which it can clone from, but you need a pair of a CVSROOT URL and a module path which can include any level of relative directory components. That's why I gave up on implementing real Clone()/Update() functions.

To wrap up, this patch teaches ghq to just keep away from CVS working trees.

@knu
Copy link
Contributor Author

knu commented Feb 4, 2019

The projects that still use CVS tend to have quite huge source trees because that's the very reason they cannot easily migrate to another VCS.

I have the huge source trees of NetBSD and OpenBSD under my ghq.root, making ghq get / ghq list run forever.

@Songmu Songmu merged commit 8e0aef4 into x-motemen:master Apr 26, 2019
Songmu added a commit that referenced this pull request Apr 27, 2019
## [v0.10.0](v0.9.0...v0.10.0) (2019-04-27)

* drop mitchellh/go-homedir dependency [#122](#122) ([Songmu](https://github.com/Songmu))
* introduce Go Modules and adjust releng files [#121](#121) ([Songmu](https://github.com/Songmu))
* Add a dummy CVS backend to recognize and skip CVS working directories [#115](#115) ([knu](https://github.com/knu))
* add -l option on get command which immediately look after get [#112](#112) ([kuboon](https://github.com/kuboon))
* add support for Fossil SCM [#98](#98) ([motemen](https://github.com/motemen))
* Use parsed username also with ssh for Git [#101](#101) ([jjv](https://github.com/jjv))
* Add ghq.completeUser config to disable user completion of `ghq get` [#118](#118) ([k0kubun](https://github.com/k0kubun))
* ghq get --vcs=<vcs> [#72](#72) ([motemen](https://github.com/motemen))
* warn if executable was not found when RunCommand [#70](#70) ([motemen](https://github.com/motemen))
* support `meta name="go-import"` to detect Go repository [#120](#120) ([Songmu](https://github.com/Songmu))
* support refs which start with URL Authority in ghq get [#119](#119) ([Songmu](https://github.com/Songmu))
@knu knu deleted the skip-cvs-workdirs branch April 28, 2019 03:09
@masutaka
Copy link

masutaka commented May 1, 2019

FYI;

My ghq.root is ~/src and I had ~/src/cvs directory.

~/src/bitbucket.org/repo-A
~/src/github.com/repo-B
~/src/cvs/repo-C

ghq-v0.9.0 list returns the below;

$ ghq-v0.9.0 list
bitbucket.org/mituharu/emacs-mac
github.com/Duhemm/launchbar-github
github.com/Homebrew/homebrew-cask
(many many directories)

However, ghq-v0.10.0 list returns only ..

$ ghq-v0.10.0 list
.

When I renamed ~/src/cvs to ~/src/cvs-repos, The result of ghq-v0.10.0 list become the same to v0.9.0.

@knu
Copy link
Contributor Author

knu commented May 1, 2019

@masutaka That is an unfortunate problem with a case insensitive filesystem. It's too bad there is no way to get the exact file name written on disk via os.Stat(); Name() of FileInfo just returns what was passed to os.Stat(). I guess the only way to perform a case sensitive match is to open the parent directory and iterate through the directory entries.

knu added a commit to knu/ghq that referenced this pull request May 1, 2019
Since `os.Stat("CVS")` successfully picks `cvs` on a case insensitive
filesystem, we need to iterate through the directory entries to see if
the directory with the exact name exists.

cf. x-motemen#115 (comment)
knu added a commit to knu/ghq that referenced this pull request May 1, 2019
Since `os.Stat("CVS")` successfully picks `cvs` on a case insensitive
filesystem, we need to iterate through directory entries to see if a
directory with the exact name exists.

cf. x-motemen#115 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants