git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 2/2] request-pull: state exact commit object name
Date: Tue, 13 Sep 2011 15:28:16 -0700	[thread overview]
Message-ID: <1315952896-17258-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1315952896-17258-1-git-send-email-gitster@pobox.com>

A typical pull-request begins like this:

  The following changes since commit f696543dad6c7ba27b0c4fab167a5687263a9ba0:

    Flobar 2.4.3 (2011-09-13 12:34:56 +0900)

  are available in the git repository at:
    git://git.kernel.org/pub/flobar.git/ master

which is followed by the shortlog and expected diffstat. This tells you
where the requester based his work on in excruciating detail, but does not
tell you what you should expect to fetch, any more than "whatever happened
to be at the named branch when you happened to notice the request."

Update the message slightly to say:

    git://git.kernel.org/pub/flobar.git/ 5738c9c21e53356ab5020912116e7f82fd2d428f ;# master

so that the line still can be cut&pasted after "git fetch" (or "git
pull"), to form a command line that looks like:

    $ git <repository> <full commit object name> ;# branch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-request-pull.sh     |    2 +-
 t/t5150-request-pull.sh |   11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/git-request-pull.sh b/git-request-pull.sh
index fc080cc..b5a2d0f 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -70,7 +70,7 @@ git show -s --format='The following changes since commit %H:
   %s (%ci)
 
 are available in the git repository at:' $baserev &&
-echo "  $url $branch" &&
+echo "  $url $headrev ;# $branch" &&
 echo &&
 
 git shortlog ^$baserev $headrev &&
diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index 9cc0a42..e9d657e 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -70,9 +70,10 @@ test_expect_success 'setup: two scripts for reading pull requests' '
 	/ in the git repository at:$/!d
 	n
 	/^$/ n
-	s/^[ 	]*\(.*\) \([^ ]*\)/please pull\
+	s/^[ 	]*\(.*\) \([^ ]*\) ;# \([^ ]*\)/please pull\
 	\1\
-	\2/p
+	\2\
+	\3/p
 	q
 	EOT
 
@@ -145,6 +146,7 @@ test_expect_success 'pull request after push' '
 	{
 		read task &&
 		read repository &&
+		read head &&
 		read branch
 	} <digest &&
 	(
@@ -153,6 +155,7 @@ test_expect_success 'pull request after push' '
 		git pull --ff-only "$repository" "$branch"
 	) &&
 	test "$branch" = for-upstream &&
+	test "$head" = "$(GIT_DIR=downstream.git git rev-parse for-upstream)" &&
 	test_cmp local/mnemonic.txt upstream-private/mnemonic.txt
 
 '
@@ -170,10 +173,10 @@ test_expect_success 'request names an appropriate branch' '
 		git request-pull initial "$downstream_url" >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
-	cat digest &&
 	{
 		read task &&
 		read repository &&
+		read head &&
 		read branch
 	} <digest &&
 	{
@@ -193,7 +196,7 @@ test_expect_success 'pull request format' '
 	  SUBJECT (DATE)
 
 	are available in the git repository at:
-	  URL BRANCH
+	  URL OBJECT_NAME ;# BRANCH
 
 	SHORTLOG
 
-- 
1.7.7.rc1.1.g1e5814

  parent reply	other threads:[~2011-09-13 22:28 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-13 16:45 [Survey] Signed push Junio C Hamano
2011-09-13 22:28 ` [PATCH v2 0/2] State commit name explicitly in request-pull messages Junio C Hamano
2011-09-13 22:28   ` [PATCH v2 1/2] fetch: allow asking for an explicit commit object by name Junio C Hamano
2011-09-13 22:28   ` Junio C Hamano [this message]
2011-09-13 23:26 ` [Survey] Signed push Guenter Roeck
2011-09-13 23:50   ` Junio C Hamano
2011-09-14  0:02     ` Junio C Hamano
2011-09-14  0:31 ` Sam Vilain
2011-09-14  0:39   ` Shawn Pearce
2011-09-14  1:03     ` Sam Vilain
     [not found] ` <CA+55aFxAQTR3sT7gekAD4qih8J+z-qwri7ZmNCPUd811xgci6w@mail.gmail.com>
2011-09-14  7:06   ` Fwd: " Linus Torvalds
2011-09-14 10:45     ` Michael Haggerty
2011-09-14 11:03       ` Matthieu Moy
2011-09-14 11:46         ` Nguyen Thai Ngoc Duy
2011-09-14 12:28         ` Johan Herland
2011-09-14 12:56           ` Ted Ts'o
2011-09-14 15:27         ` Linus Torvalds
2011-09-14 15:42           ` Matthieu Moy
2011-09-14 16:14           ` Johan Herland
2011-09-14 22:51             ` Philip Oakley
2011-09-14 23:30               ` Linus Torvalds
2011-09-14 23:44                 ` Junio C Hamano
2011-09-14 15:25       ` Linus Torvalds
2011-09-14 17:52         ` Junio C Hamano
2011-09-14 18:36           ` Linus Torvalds
2011-09-14 17:49     ` Junio C Hamano
2011-09-14 20:52       ` Sam Vilain
2011-09-16 19:04       ` [PATCH v3] request-pull: state what commit to expect Junio C Hamano
2011-09-20 23:01         ` Junio C Hamano
2011-09-20 23:02           ` [PATCH 2/3] branch: teach --edit-description option Junio C Hamano
2011-09-21  0:15             ` Andrew Ardill
2011-09-21  2:44               ` Junio C Hamano
2011-09-20 23:03           ` [PATCH] request-pull: use the branch description Junio C Hamano
2011-09-22 22:09           ` [PATCH 0/6] A handful of "branch description" patches Junio C Hamano
2011-09-22 22:09             ` [PATCH 1/6] branch: add read_branch_desc() helper function Junio C Hamano
2011-09-22 22:09             ` [PATCH 2/6] format-patch: use branch description in cover letter Junio C Hamano
2011-09-22 22:09             ` [PATCH 3/6] branch: teach --edit-description option Junio C Hamano
2011-09-23  9:00               ` Michael J Gruber
2011-09-23  9:47               ` Nguyen Thai Ngoc Duy
2011-09-23 19:04                 ` Junio C Hamano
2011-09-25  5:21                   ` Nguyen Thai Ngoc Duy
2011-09-22 22:09             ` [PATCH 4/6] request-pull: modernize style Junio C Hamano
2011-09-22 22:09             ` [PATCH 5/6] request-pull: state what commit to expect Junio C Hamano
2011-09-22 22:09             ` [PATCH 6/6] request-pull: use the branch description Junio C Hamano
2011-09-23  8:56             ` [PATCH 0/6] A handful of "branch description" patches Michael J Gruber
2011-09-23 20:18               ` Jeff King
2011-09-23 20:52                 ` Junio C Hamano
2011-09-23 20:53                   ` Jeff King
2011-09-24 14:42                 ` Michael J Gruber
2011-09-27 21:58                   ` Jeff King
2011-09-28  4:23                     ` Annotated branch ≈ annotated tag? Michael Haggerty
2011-09-28  7:12                       ` Andrew Ardill
2011-09-28  8:04                         ` Michael Haggerty
2011-09-28  8:58                           ` Branch annotations [Re: Annotated branch ≈ annotated tag?] Michael J Gruber
2011-09-29  6:44                       ` Annotated branch ≈ annotated tag? Jeff King
2011-09-14 11:58 ` [Survey] Signed push Nguyen Thai Ngoc Duy
2011-09-14 21:05   ` Jonathan Nieder
2011-09-14 22:42     ` Nguyen Thai Ngoc Duy
2011-09-15 17:50       ` Jeff King
2011-09-14 19:35 ` Andy Lutomirski
2011-09-14 20:40   ` Junio C Hamano
2011-09-14 20:49     ` Andrew Lutomirski

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=1315952896-17258-3-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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).