Re: [1.8.0] forbid full fetchspecs in git-pull
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Jan 31, 2011, 23:15 UTC
- Message-ID
- <AANLkTikxcd+gzeuJsQX1V5Wses8xWMnshdrOnYTvXgTq@mail.gmail.com>
- In-Reply-To
- <201101312255.59841.trast@student.ethz.ch>
On Mon, Jan 31, 2011 at 10:55:59PM +0100, Thomas Rast wrote:
Show 13 quoted lines
> 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