-
Notifications
You must be signed in to change notification settings - Fork 691
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
cabal get
should not reset the default branch to the given tag
#10278
Comments
mhh do you happen to know what was the rationale behind |
I don't know the rationale but through Github's blame I found this PR #5536 |
Excellent sleuthing. From that discussion:
The meaning of “since that's what we're asked to do, anyway” eludes me. |
@jasagredo wrote:
I agree. Let's review the source repository mechanism with its purposes:
Not really relevant for this issue, but touching the source repository story: I find it irritating that that |
I do agree that |
Currently, having a package that declares the following
source-repository
stanza in the available repositories (hackage):When one runs
cabal get <pkg> -sthis -d<somedir>
will perform the following sequence of commands:I would argue that the
git reset
is just wrong. It will reset whichever branch was cloned to the tag, resulting in a state that disagrees with the git server. My proposal is as follows:branch
andtag
should be exclusive. To be precise, they could be merged into either of them or some new name. Either way, only one of those has to/should be provided. Probablyref
orrev
would be a good name.git clone <url> --branch <branch-or-tag>
as git can handle tags in that argument.-d
should be used as the output directory, and not as a parent folder for the clone. This means that usingcabal get <pkg> -sthis -d<somedir>
will clone the repo in./somedir
and not in./somedir/reponame
. This can be achieved by invokinggit clone --branch <branch-or-tag> <url> <somedir>
Note that the same reasoning could apply to
source-repository-package
as those also allow forbranch
andtag
.The text was updated successfully, but these errors were encountered: