git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
CBChris Ball <cjb@laptop.org>
Date
Oct 4, 2011, 01:47 UTC
Message-ID
<m28vp1msth.fsf@bob.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
Next: Junio C Hamano
Message 1 of 3 in “request-pull: List the hash that results from merging onto baserev”
  1. request-pull: List the hash that results from merging onto baserevChris Ball, Oct 4, 2011
  2. Junio C HamanoOct 4, 2011
  3. Chris BallOct 4, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.