From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Ted Ts'o" <tytso@mit.edu>, Git Mailing List <git@vger.kernel.org>
Subject: Re: GIT PULL] ext4 updates for 3.5
Date: Fri, 01 Jun 2012 11:55:13 -0700 [thread overview]
Message-ID: <7v8vg63lri.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CA+55aFxgZupkAotfjUuWcfwTzHDYg0Afezme62P17=EX2KN+UQ@mail.gmail.com> (Linus Torvalds's message of "Fri, 1 Jun 2012 10:56:43 -0700")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> Apparently git request-pull is too damn smart for its own good, and
> will find the tags even when they aren't mentioned, making you think
> it made it to me. Bot it doesn't - so then I have to go search for
> them by hand.
Something like this, perhaps.
git-request-pull.sh | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/git-request-pull.sh b/git-request-pull.sh
index e6438e2..5ca786e 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -57,9 +57,13 @@ headrev=$(git rev-parse --verify "$head"^0) || exit
merge_base=$(git merge-base $baserev $headrev) ||
die "fatal: No commits in common between $base and $head"
-# $head is the token given from the command line. If a ref with that
-# name exists at the remote and their values match, we should use it.
-# Otherwise find a ref that matches $headrev.
+# $head is the token given from the command line, and $tag_name, if
+# exists, is the tag we are going to show the commit information for.
+# If that tag exists at the remote and it points at the commit, use it.
+# Otherwise, if a branch with the same name as $head exists at the remote
+# and their values match, use that instead.
+#
+# Otherwise find a random ref that matches $headrev.
find_matching_ref='
sub abbr {
my $ref = shift;
@@ -70,24 +74,29 @@ find_matching_ref='
}
}
- my ($exact, $found);
+ my ($tagged, $branch, $found);
while (<STDIN>) {
my ($sha1, $ref, $deref) = /^(\S+)\s+(\S+?)(\^\{\})?$/;
next unless ($sha1 eq $ARGV[1]);
$found = abbr($ref);
+ if ($deref) {
+ $tagged = $found;
+ last;
+ }
if ($ref =~ m|/\Q$ARGV[0]\E$|) {
$exact = $found;
- last;
}
}
- if ($exact) {
+ if ($tagged) {
+ print "$tagged\n";
+ } elsif ($exact) {
print "$exact\n";
} elsif ($found) {
print "$found\n";
}
'
-ref=$(git ls-remote "$url" | perl -e "$find_matching_ref" "$head" "$headrev")
+ref=$(git ls-remote "$url" | perl -e "$find_matching_ref" "$head" "$headrev" "$tag_name")
url=$(git ls-remote --get-url "$url")
next prev parent reply other threads:[~2012-06-01 18:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1SaTSI-0005UV-4B@tytso-glaptop.cam.corp.google.com>
[not found] ` <CA+55aFwk8oYx8EKWdT=5cMTLK7RDz8GQdGmHk2KXwcCq+Bb8PA@mail.gmail.com>
[not found] ` <CA+55aFwwfMTN=WGQGmFO7DYeBUOGA7V4_6XueQS4JAzeykwn3Q@mail.gmail.com>
[not found] ` <20120601174336.GA15778@thunk.org>
2012-06-01 17:56 ` GIT PULL] ext4 updates for 3.5 Linus Torvalds
2012-06-01 18:55 ` Junio C Hamano [this message]
2012-06-01 19:00 ` Junio C Hamano
2012-06-01 19:02 ` Linus Torvalds
2012-06-01 20:38 ` Ted Ts'o
2012-06-01 20:43 ` Linus Torvalds
2012-06-01 20:52 ` Ted Ts'o
2012-06-01 20:52 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v8vg63lri.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).