Git development
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: git@vger.kernel.org
Subject: [PATCH] request-pull: List the hash that results from merging onto baserev
Date: Mon, 03 Oct 2011 21:47:06 -0400	[thread overview]
Message-ID: <m28vp1msth.fsf@bob.laptop.org> (raw)

This patch modifies the request-pull message to contain both the base
hash and the top commit hash that results when the new commits are
merged onto that base.

The motivation for doing this is to turn cryptographically signing a
pull request into an operation that enables detection of commits having
been maliciously altered before being downloaded.  Before this patch, a
pull request contained only a list of commit names and a diffstat; this
is not sufficient to detect subsequent alteration of the changed files.

After this patch, the person merging may choose to rewind to $baserev,
apply the received commits, and check that the resulting hash matches.

Signed-off-by: Chris Ball <cjb@laptop.org>
---
 git-request-pull.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/git-request-pull.sh b/git-request-pull.sh
index fc080cc..9a686a5 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -73,6 +73,9 @@ are available in the git repository at:' $baserev &&
 echo "  $url $branch" &&
 echo &&
 
+echo "(Applying these commits produces hash $headrev)" &&
+echo &&
+
 git shortlog ^$baserev $headrev &&
 git diff -M --stat --summary $patch $merge_base..$headrev || exit
 exit $status
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

             reply	other threads:[~2011-10-04  1:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04  1:47 Chris Ball [this message]
2011-10-04  3:22 ` [PATCH] request-pull: List the hash that results from merging onto baserev Junio C Hamano
2011-10-04  3:45   ` Chris Ball

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=m28vp1msth.fsf@bob.laptop.org \
    --to=cjb@laptop.org \
    --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