# [PATCH] request-pull: List the hash that results from merging onto baserev

3 messages from 2011-10-04 to 2011-10-04. Participants: Chris Ball, Junio C Hamano.
Thread: https://gitlist.dev/t/28565

## Chris Ball, 2011-10-04 01:47

Subject: [PATCH] request-pull: List the hash that results from merging onto baserev
Message-ID: <m28vp1msth.fsf@bob.laptop.org>
URL: https://gitlist.dev/e/m28vp1msth.fsf%40bob.laptop.org

```
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

```

## Junio C Hamano, 2011-10-04 03:22

Subject: Re: [PATCH] request-pull: List the hash that results from merging onto baserev
Message-ID: <7vzkhhcufo.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzkhhcufo.fsf%40alter.siamese.dyndns.org
In-Reply-To: <m28vp1msth.fsf@bob.laptop.org>

```
Isn't the series leading to 7eb32b8 (request-pull: use the branch
description, 2011-09-20) insufficient?

```

## Chris Ball, 2011-10-04 03:45

Subject: Re: [PATCH] request-pull: List the hash that results from merging onto baserev
Message-ID: <m2r52tl8rp.fsf@bob.laptop.org>
URL: https://gitlist.dev/e/m2r52tl8rp.fsf%40bob.laptop.org
In-Reply-To: <7vzkhhcufo.fsf@alter.siamese.dyndns.org>

```
Hi Junio,

On Mon, Oct 03 2011, Junio C Hamano wrote:
> Isn't the series leading to 7eb32b8 (request-pull: use the branch
> description, 2011-09-20) insufficient?

Yes, your series is much better; sorry for the noise.  I didn't know
about the work in 'pu', but see now that I should have looked there.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

```
