{"thread":{"id":"1713","subject":"Ugly \"git pull ..\" merge messages","startedAt":"2005-09-02T07:46:24Z","lastAt":"2005-09-02T09:39:37Z","messageCount":2,"participants":["Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"8003","messageId":"Pine.LNX.4.58.0509011117130.6795@evo.osdl.org","threadId":"1713","inReplyTo":null,"subject":"Ugly \"git pull ..\" merge messages","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-09-02T07:46:24Z","receivedAt":"2005-09-02T07:46:24Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nJunio, I think this happened when you rewrote the pull/push stuff to do\nshorthands..\n\nLately, \"git pull\" generates a lot of extra crud in the single-line commit\nmessage, which is annoying because a lot of tools will thus actually not\nshow enough of the line to be valid.\n\nFor example, it used to get rid of the \".git\" at the end, and it didn't\nbother to say \"HEAD\". So\n\n    Merge HEAD from master.kernel.org:/home/rmk/linux-2.6-arm.git\n\nused to be just\n\n    Merge master.kernel.org:/home/rmk/linux-2.6-arm\n\nwhich is actually much nicer. It tends to fit in the gitk description\nwindow.\n\nIn this example:\n\n    Merge refs/heads/release from master.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6\n\nI had manually removed the \".git\" (since git-fetch-pack will happily add\nit back), so it doesn't have the \".git\" at the end of the message, but\ninstead it has a ref-name that is the internal git path rather than the\npath that I actually specified. Now, we didn't use to be shorter, but at\nleast it used to be more readable, with\n\n    Merge 'release' branch of master.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6\n\n(Ok, it's slightly shorter, but not much - but my point is that it's\nactually more readable).\n\nCould we get the nicer messages back, please?\n\n\t\tLinus\n"},{"id":"8009","messageId":"7vr7c7izae.fsf@assigned-by-dhcp.cox.net","threadId":"1713","inReplyTo":"Pine.LNX.4.58.0509011117130.6795@evo.osdl.org","subject":"[PATCH] Fix automerge message.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-02T09:39:37Z","receivedAt":"2005-09-02T09:39:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The rewrite done while adding the shorthand support made the remote\nrefname recorded in the commit message too long for human consumption,\nwhile losing information by using the shorthand not the real URL to\nname the remote repository there.  They were both bad changes done\nwithout enough thinking.\n\nPointed out by Linus.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n git-fetch-script |   51 +++++++++++++++++++++++++++++++++------------------\n 1 files changed, 33 insertions(+), 18 deletions(-)\n\n06ec2b4bb4ab9096d1304ba5a2ec388078dcdf7f\ndiff --git a/git-fetch-script b/git-fetch-script\n--- a/git-fetch-script\n+++ b/git-fetch-script\n@@ -55,21 +55,41 @@ append_fetch_head () {\n     remote_nick_=\"$4\"\n     local_name_=\"$5\"\n \n+    # remote-nick is the URL given on the command line (or a shorthand)\n+    # remote-name is the $GIT_DIR relative refs/ path we computed\n+    # for this refspec.\n+    case \"$remote_name_\" in\n+    HEAD)\n+\tnote_= ;;\n+    refs/heads/*)\n+\tnote_=\"$(expr \"$remote_name_\" : 'refs/heads/\\(.*\\)')\"\n+\tnote_=\"branch '$note_' of \" ;;\n+    refs/tags/*)\n+\tnote_=\"$(expr \"$remote_name_\" : 'refs/tags/\\(.*\\)')\"\n+\tnote_=\"tag '$note_' of \" ;;\n+    *)\n+\tnote_=\"$remote_name of \" ;;\n+    esac\n+    remote_1_=$(expr \"$remote_\" : '\\(.*\\)\\.git/*$') &&\n+\tremote_=\"$remote_1_\"\n+    note_=\"$note_$remote_\"\n+\n     # 2.6.11-tree tag would not be happy to be fed to resolve.\n     if git-cat-file commit \"$head_\" >/dev/null 2>&1\n     then\n \theadc_=$(git-rev-parse --verify \"$head_^0\") || exit\n-\tnote_=\"$headc_\t$remote_name_ from $remote_nick_\"\n-\techo \"$note_\" >>$GIT_DIR/FETCH_HEAD\n-\techo >&2 \"* committish: $note_\"\n+\techo \"$headc_\t$note_\" >>$GIT_DIR/FETCH_HEAD\n+\techo >&2 \"* committish: $head_\"\n+\techo >&2 \"  $note_\"\n     else\n-\techo >&2 \"* non-commit: $note_\"\n+\techo >&2 \"* non-commit: $head_\"\n+\techo >&2 \"  $note_\"\n     fi\n     if test \"$local_name_\" != \"\"\n     then\n \t# We are storing the head locally.  Make sure that it is\n \t# a fast forward (aka \"reverse push\").\n-\tfast_forward_local \"$local_name_\" \"$head_\" \"$remote_\" \"$remote_name_\"\n+\tfast_forward_local \"$local_name_\" \"$head_\" \"$note_\"\n     fi\n }\n \n@@ -80,11 +100,9 @@ fast_forward_local () {\n \t# is no way to guarantee \"fast-forward\" anyway.\n \tif test -f \"$GIT_DIR/$1\"\n \tthen\n-\t\techo >&2 \"* $1: updating with $4\"\n-\t\techo >&2 \"  from $3.\"\n+\t\techo >&2 \"* $1: updating with $3\"\n \telse\n-\t\techo >&2 \"* $1: storing $4\"\n-\t\techo >&2 \"  from $3.\"\n+\t\techo >&2 \"* $1: storing $3\"\n \tfi\n \techo \"$2\" >\"$GIT_DIR/$1\" ;;\n \n@@ -97,31 +115,28 @@ fast_forward_local () {\n \t    mb=$(git-merge-base \"$local\" \"$2\") &&\n \t    case \"$2,$mb\" in\n \t    $local,*)\n-\t\techo >&2 \"* $1: same as $4\"\n-\t\techo >&2 \"  from $3\"\n+\t\techo >&2 \"* $1: same as $3\"\n \t\t;;\n \t    *,$local)\n-\t\techo >&2 \"* $1: fast forward to $4\"\n-\t\techo >&2 \"  from $3\"\n+\t\techo >&2 \"* $1: fast forward to $3\"\n \t\t;;\n \t    *)\n \t\tfalse\n \t\t;;\n \t    esac || {\n-\t\techo >&2 \"* $1: does not fast forward to $4\"\n+\t\techo >&2 \"* $1: does not fast forward to $3;\"\n \t\tcase \"$force,$single_force\" in\n \t\tt,* | *,t)\n-\t\t\techo >&2 \"  from $3; forcing update.\"\n+\t\t\techo >&2 \"  forcing update.\"\n \t\t\t;;\n \t\t*)\n \t\t\tmv \"$GIT_DIR/$1.lock\" \"$GIT_DIR/$1.remote\"\n-\t\t\techo >&2 \"  from $3; leaving it in '$1.remote'\"\n+\t\t\techo >&2 \"  leaving it in '$1.remote'\"\n \t\t\t;;\n \t\tesac\n \t    }\n \telse\n-\t\techo >&2 \"* $1: storing $4\"\n-\t\techo >&2 \"  from $3.\"\n+\t\techo >&2 \"* $1: storing $3\"\n \tfi\n \ttest -f \"$GIT_DIR/$1.lock\" &&\n \t    mv \"$GIT_DIR/$1.lock\" \"$GIT_DIR/$1\"\n"}]}