4 ms·
> "git branch --set-upstream" is deprecated and may be removed in a relatively distant future. "git branch [-u|--set-upstream-to]" has been introduced with a s
by aneth4 14y ago
> "git branch --set-upstream" is deprecated and may be removed in a relatively distant future. "git branch [-u|--set-upstream-to]" has been introduced with a saner order of arguments.
It would be great if changes to the git CLI were thoroughly thought through instead of one-off fixes like this. This is the reason the interface is such a mess.
git branch foo --track origin/foo
But if you forgot --track:
git branch foo
then it's:
git branch foo --set-upstream-to origin/foo
and don't you dare do
git branch --set-upstream-to origin/foo
Upstream and track are the same - why two different words?
And now we have --set-upstream-to and --set-upstream, which will be fun for git newbies to distinguish.
- makeramen 14y agoWait, what exactly happens in that last one that I shouldn't dare do?
- aneth4 14y agoI should have written: git branch --set-upstream origin/foo This counter-intuitively creates a LOCAL (!) branch named origin/foo which tracks the current branch. I would expect this to set the upstream of the current branch, given that most commands operate on the current branch unless otherwise specified. Instead it does something completely unexpected and useless.
- ibotty 14y agowhich invalidates part of your point, because --set-upstream is now _deprecated_.
- aneth4 14y agoIt's deprecated in the next release not this one, and it will be around for years to come. People will google and find the old way documented and have to read up on the difference, adding to the cognitivie baggage of git. Regardless, my point is the interface is horrible and this is just adding to the patchwork. Why not add --track semantics or unify these flags?
- cmn 14y ago--set-upstream is deprecated in this release.
- Johngibb 14y agoDeprecated, but not removed yet. It "may be removed in a relatively distant future"
- cmn 14y agoThis is what deprecated means. You can't just remove an API that's existed for years and scripts may depend on without giving them time to adapt. This shows a warning when it's used so it's clear which scripts should be changed.
- cmn 14y agoSo why are you unhappy about this option being deprecated? Have you tried it in this release? It tells you it's deprecated and which options exist. If you do what you show in this command, it tells you how to undo it with the new more sensible option.
- zby 14y agoKind of related: The usual pattern of a copy command: copy source destination The pattern of git push command push destination source:destination http://perlalchemy.blogspot.com/2011/04/git-push-and-other-copy-commands.html http://perlalchemy.blogspot.com/2011/04/git-push-and-other-c...
- nicholassmith 14y agoIt does occasionally feel like the CLI development happens with a very short time scale imagined rather than planning it out, which is slightly odd given Linus' involvement.