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

Re: [1.8.0] forbid full fetchspecs in git-pull

From: Dmitry Potapov <hidden>
Date: 2016-06-15 22:50:29

Possibly related (same subject, not in this thread)

On Mon, Jan 31, 2011 at 10:55:59PM +0100, Thomas Rast wrote:
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 ':'.
Hmm... I have always thought about "git pull repo refspec" as
"git fetch repo refspec && git merge FETCH_HEAD"
and "git fetch" refuses to fetch into the current branch of a non-bare
repository, so I expected "git merge" to fail in this case too, but it
succeeded though with some warning that fetch updated the current
branch head. I think it is inconsistent and should be fixed, and that
will fix the mentioned confusion as well.

As to disallowing ':' in refspec completely, I am not so sure... Not
that I think it is very useful, but also I don't see how it can hurt
someone provided that the target branch cannot be the current branch.


Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help