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

[PATCH 3/3] Ignore no-op changes in paranoid update hook

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 26, 2008, 02:18 UTC
Message-ID
<20080526021805.GC29990@spearce.org>

If the hook gets invoked with identical old and new ids there is no change taking place. We probably should not have been called, but instead of failing silently allow the no-op.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 contrib/hooks/update-paranoid |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid
index ae94822..d18b317 100644
--- a/contrib/hooks/update-paranoid
+++ b/contrib/hooks/update-paranoid
@@ -259,6 +259,7 @@ deny "Refusing funny ref $ref" unless $ref =~ s,^refs/,,;
 deny "Bad old value $old" unless $old =~ /^[a-z0-9]{40}$/;
 deny "Bad new value $new" unless $new =~ /^[a-z0-9]{40}$/;
 deny "Cannot determine who you are." unless $this_user;
+grant "No change requested." if $old eq $new;
 
 $repository_name = File::Spec->rel2abs($git_dir);
 $repository_name =~ m,/([^/]+)(?:\.git|/\.git)$,;
-- 
1.5.5.1.501.gefb4
Message 1 of 1 in “Ignore no-op changes in paranoid update hook”
  1. 3/3 Ignore no-op changes in paranoid update hookShawn O. Pearce, May 26, 2008

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.