Linus Torvalds [off-list ref] writes:
Junio - I think we should make "git pull" refuse to merge more than one
head. If somebody wants to do an octopus merge, they can use "git merge"
instead. Hmm?
That would lose the autogenerated merge message. I can be
talked into making it 'core.expert = true' only, though.
More troubling is 'git pull --tags' should *not* even try to use
them for merging, so if it does that that needs to be fixed.
As I recall how I did (wanted to do) it, the default rule for
'pull' is:
- if you have explicit head names on the command line (--tags
does not count -- you are not stating name explicitly),
all of them are merged into an octopus;
- otherwise if you used remotes/ shorthand the head(s) on the
first Pull: line;
- otherwise HEAD;
And the code _is_ broken. Here is a proposed fix.
-- >8 --
[PATCH] Do not mark tags fetched via --tags flag as mergeable
Otherwise "git pull --tags" would mistakenly try to merge all of
them, which is never what the user wants.
Signed-off-by: Junio C Hamano <redacted>
---
diff --git a/git-fetch.sh b/git-fetch.sh
index 767ca61..125bcea 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -192,7 +192,7 @@ then
sed -e '
/\^/d
s/^[^ ]* //
- s/.*/&:&/')
+ s/.*/.&:&/')
if test "$#" -gt 1
then
# remote URL plus explicit refspecs; we need to merge them.