Thread (63 messages) flat view 63 messages, 25 authors, 2016-06-15

[1.8.0] forbid full fetchspecs in git-pull

From: Thomas Rast <hidden>
Date: 2016-06-15 22:50:29

Possibly related (same subject, not in this thread)

Proposal:

git-pull inherits the full fetchspec invocation syntax from git-fetch,
so that you can do e.g.

  git pull origin master:master

usually shooting yourself in the foot in the process.  See e.g.

  http://thread.gmane.org/gmane.comp.version-control.git/130819/focus=130879 [item 1]

Prohibit this invocation, i.e., disallow any second argument to
git-pull that contains ':'.


History:

I submitted a patch ages ago:

  http://article.gmane.org/gmane.comp.version-control.git/130822

Sean seemed to be the only one in favour of the old behaviour, but I
was too lazy to push it past him.  (There were some issues with the
test as well.)

I honestly still don't see a valid use-case for the full syntax, let
alone having seen one in the wild; in cases where you are inclined to
do

  git pull origin foo:bar

you probably don't need 'bar' to begin with if you can use
'origin/foo' instead, assuming the previous proposal on remote-branch
updating is also included.


Risks:

It's an incompatibility, so scripts may break.


Migration plan:

None; disallow it at the 1.8.0 boundary.

If someone makes a good case why his hands are trained that way, we
might introduce a config variable instead.


-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help