{"thread":{"id":"30679","subject":"Re: GIT PULL] ext4 updates for 3.5","startedAt":"2012-06-01T17:56:43Z","lastAt":"2012-06-01T20:52:16Z","messageCount":8,"participants":["Linus Torvalds","Junio C Hamano","Ted Ts'o"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192680","messageId":"CA+55aFxgZupkAotfjUuWcfwTzHDYg0Afezme62P17=EX2KN+UQ@mail.gmail.com","threadId":"30679","inReplyTo":"20120601174336.GA15778@thunk.org","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2012-06-01T17:56:43Z","receivedAt":"2012-06-01T17:56:43Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Fri, Jun 1, 2012 at 10:43 AM, Ted Ts'o <tytso@mit.edu> wrote:\n>\n> So I should do \"git request-pull origin git://... ext4_for_linus\" next\n> time, right?\n\nRight.\n\n> Sorry about that.  I thought it had included the reference to tag\n> automatically since the text of the tag showed in the request-pull\n> text.\n\nApparently git request-pull is too damn smart for its own good, and\nwill find the tags even when they aren't mentioned, making you think\nit made it to me. Bot it doesn't - so then I have to go search for\nthem by hand.\n\nAdded Junio and git to the cc: if git finds the tag and uses that for\nthe request-pull message text, then it should use the tagname for the\npull request line too. Or, alternatively, don't be smart at all, and\nforce users to name the tag explicitly. The current \"both smart and\ndumb\" combination seems to be the worst of both world.\n\n              Linus\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-ext4\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"192683","messageId":"7v8vg63lri.fsf@alter.siamese.dyndns.org","threadId":"30679","inReplyTo":"CA+55aFxgZupkAotfjUuWcfwTzHDYg0Afezme62P17=EX2KN+UQ@mail.gmail.com","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-01T18:55:13Z","receivedAt":"2012-06-01T18:55:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> Apparently git request-pull is too damn smart for its own good, and\n> will find the tags even when they aren't mentioned, making you think\n> it made it to me. Bot it doesn't - so then I have to go search for\n> them by hand.\n\nSomething like this, perhaps.\n\n git-request-pull.sh | 23 ++++++++++++++++-------\n 1 file changed, 16 insertions(+), 7 deletions(-)\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex e6438e2..5ca786e 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -57,9 +57,13 @@ headrev=$(git rev-parse --verify \"$head\"^0) || exit\n merge_base=$(git merge-base $baserev $headrev) ||\n die \"fatal: No commits in common between $base and $head\"\n \n-# $head is the token given from the command line. If a ref with that\n-# name exists at the remote and their values match, we should use it.\n-# Otherwise find a ref that matches $headrev.\n+# $head is the token given from the command line, and $tag_name, if\n+# exists, is the tag we are going to show the commit information for.\n+# If that tag exists at the remote and it points at the commit, use it.\n+# Otherwise, if a branch with the same name as $head exists at the remote\n+# and their values match, use that instead.\n+#\n+# Otherwise find a random ref that matches $headrev.\n find_matching_ref='\n \tsub abbr {\n \t\tmy $ref = shift;\n@@ -70,24 +74,29 @@ find_matching_ref='\n \t\t}\n \t}\n \n-\tmy ($exact, $found);\n+\tmy ($tagged, $branch, $found);\n \twhile (<STDIN>) {\n \t\tmy ($sha1, $ref, $deref) = /^(\\S+)\\s+(\\S+?)(\\^\\{\\})?$/;\n \t\tnext unless ($sha1 eq $ARGV[1]);\n \t\t$found = abbr($ref);\n+\t\tif ($deref) {\n+\t\t\t$tagged = $found;\n+\t\t\tlast;\n+\t\t}\n \t\tif ($ref =~ m|/\\Q$ARGV[0]\\E$|) {\n \t\t\t$exact = $found;\n-\t\t\tlast;\n \t\t}\n \t}\n-\tif ($exact) {\n+\tif ($tagged) {\n+\t\tprint \"$tagged\\n\";\n+\t} elsif ($exact) {\n \t\tprint \"$exact\\n\";\n \t} elsif ($found) {\n \t\tprint \"$found\\n\";\n \t}\n '\n \n-ref=$(git ls-remote \"$url\" | perl -e \"$find_matching_ref\" \"$head\" \"$headrev\")\n+ref=$(git ls-remote \"$url\" | perl -e \"$find_matching_ref\" \"$head\" \"$headrev\" \"$tag_name\")\n \n url=$(git ls-remote --get-url \"$url\")\n \n"},{"id":"192684","messageId":"7v4nqu3lhy.fsf@alter.siamese.dyndns.org","threadId":"30679","inReplyTo":"7v8vg63lri.fsf@alter.siamese.dyndns.org","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-01T19:00:57Z","receivedAt":"2012-06-01T19:00:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> +# $head is the token given from the command line, and $tag_name, if\n> +# exists, is the tag we are going to show the commit information for.\n> +# If that tag exists at the remote and it points at the commit, use it.\n> +# Otherwise, if a branch with the same name as $head exists at the remote\n> +# and their values match, use that instead.\n> +#\n> +# Otherwise find a random ref that matches $headrev.\n\nIt may also be a good idea to add something like:\n\n\tif test -n \"$tag_name\" && test \"tags/$tag_name\" != \"$ref\"\n        then\n\t\techo \"warning: have you really pushed the tag yet???\"\n\tfi\n\nsomewhere near we show \"cat-file tag $tag_name\" information in the\noutput.\n"},{"id":"192685","messageId":"CA+55aFwJnKXAMjLaS3MXLcpqJKKdhufFRTKzdM1_aH5ebqx+BQ@mail.gmail.com","threadId":"30679","inReplyTo":"7v4nqu3lhy.fsf@alter.siamese.dyndns.org","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2012-06-01T19:02:31Z","receivedAt":"2012-06-01T19:02:31Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Fri, Jun 1, 2012 at 12:00 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> It may also be a good idea to add something like:\n>\n>        if test -n \"$tag_name\" && test \"tags/$tag_name\" != \"$ref\"\n>        then\n>                echo \"warning: have you really pushed the tag yet???\"\n>        fi\n>\n> somewhere near we show \"cat-file tag $tag_name\" information in the\n> output.\n\nAck.\n\n          Linus\n"},{"id":"192692","messageId":"20120601203836.GB19987@thunk.org","threadId":"30679","inReplyTo":"7v4nqu3lhy.fsf@alter.siamese.dyndns.org","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Ted Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2012-06-01T20:38:36Z","receivedAt":"2012-06-01T20:38:36Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"One other thought.  One of the reasons why I used \"dev\" and not\n\"ext4_for_linus\" in my git request-pull command line was because that\nseveral months ago I had created a branch called ext4_for_linus, and I\nhadn't gotten around to deleting it, so I figured I'd just use \"dev\"\ninstead, since it was non-ambiguous.\n\nIf there is a case where there is both tag and a branch with the same\nname, it might be a good idea for request-pull not just to issue a\nwarning, since the user might not notice the warning, but to just\nabort --- and make the user explicitly type refs/tags/ext4_for_linus\nor refs/heads/ext4_for_linus.\n\nMost of the time if the user ignores the warning about the ambiguity,\nit's not such a big deal, but in the case of a pull-request, he or she\nis going to be possibly embarassing themself publically, so it might\nbe better to explicitly list the reason why a non-qualified refname is\nambiguous and force the user to pick the right one.\n\nIt's a minor point, and usually I double check the commit id in the\npull request just to be sure, so it might be considered too much of\ncoddling the user, but it might be a good safety check to add.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"192693","messageId":"CA+55aFyqN2OJkSKVLERtMr-P6OKWEfjrS6eP8OtDyoZB0mmR3w@mail.gmail.com","threadId":"30679","inReplyTo":"20120601203836.GB19987@thunk.org","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2012-06-01T20:43:35Z","receivedAt":"2012-06-01T20:43:35Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Fri, Jun 1, 2012 at 1:38 PM, Ted Ts'o <tytso@mit.edu> wrote:\n> One other thought.  One of the reasons why I used \"dev\" and not\n> \"ext4_for_linus\" in my git request-pull command line was because that\n> several months ago I had created a branch called ext4_for_linus, and I\n> hadn't gotten around to deleting it, so I figured I'd just use \"dev\"\n> instead, since it was non-ambiguous.\n\nYou can always just use \"tags/xyzzy\" to disambiguate..\n\n                  Linus\n"},{"id":"192694","messageId":"20120601205209.GC19987@thunk.org","threadId":"30679","inReplyTo":"CA+55aFyqN2OJkSKVLERtMr-P6OKWEfjrS6eP8OtDyoZB0mmR3w@mail.gmail.com","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Ted Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2012-06-01T20:52:09Z","receivedAt":"2012-06-01T20:52:09Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Fri, Jun 01, 2012 at 01:43:35PM -0700, Linus Torvalds wrote:\n> On Fri, Jun 1, 2012 at 1:38 PM, Ted Ts'o <tytso@mit.edu> wrote:\n> > One other thought.  One of the reasons why I used \"dev\" and not\n> > \"ext4_for_linus\" in my git request-pull command line was because that\n> > several months ago I had created a branch called ext4_for_linus, and I\n> > hadn't gotten around to deleting it, so I figured I'd just use \"dev\"\n> > instead, since it was non-ambiguous.\n> \n> You can always just use \"tags/xyzzy\" to disambiguate..\n\nAh, I thought you always had to type the full \"refs/tags/..\"\nspecification.  I didn't realize it did substring matching.  Besides,\n\"dev\" was much shorter and easier to type.  :-)\n\nOne of the things which is easy for a novice to miss is the \"warning:\next4_for_linus is ambiguous\" message, though.  And I suspect many\nnovices don't know about the \"git show-refs -a | grep ambiguous_tag\"\ntrick to figure out where the ambiguity is coming from.  So if we are\ngoing to give a warning, it might be good if we actually told the user\nwhat were the other choices, and which choice git was going to choose.\nMost of the time it seems to choose the right thing, but trusting\ncomputer programs to choose the right answer from something ambiguous\nvia some hueristic always scares the bejesus out of me....\n\n    \t \t   \t  \t     \t     - Ted\n"},{"id":"192695","messageId":"7vhauu21rz.fsf@alter.siamese.dyndns.org","threadId":"30679","inReplyTo":"CA+55aFyqN2OJkSKVLERtMr-P6OKWEfjrS6eP8OtDyoZB0mmR3w@mail.gmail.com","subject":"Re: GIT PULL] ext4 updates for 3.5","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-01T20:52:16Z","receivedAt":"2012-06-01T20:52:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> On Fri, Jun 1, 2012 at 1:38 PM, Ted Ts'o <tytso@mit.edu> wrote:\n>> One other thought.  One of the reasons why I used \"dev\" and not\n>> \"ext4_for_linus\" in my git request-pull command line was because that\n>> several months ago I had created a branch called ext4_for_linus, and I\n>> hadn't gotten around to deleting it, so I figured I'd just use \"dev\"\n>> instead, since it was non-ambiguous.\n>\n> You can always just use \"tags/xyzzy\" to disambiguate..\n\nNot only that, the \"look at the ls-remote output and guess what you\nare teeling the recipient to pull\" code gives tags/ext4_for_linus\neven if there is not ext4-for-linus branch; if I recall correctly we\ndid this on purpose so that older git that did not DWIM \"git pull\next4_for_linus\" to look at targs/ext4_for_linus.\n"}]}