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

[PATCH guilt] guilt-fork: Rename patches sequentially (ala quilt)

From
ELEric Lesh <eclesh@ucla.edu>
Date
Mar 28, 2007, 03:43 UTC
Message-ID
<1175053438.5945.7.camel@localhost>
From: Eric Lesh <eclesh@ucla.edu>
Date: Tue, 27 Mar 2007 20:18:10 -0700
Subject: [PATCH] guilt-fork: Rename patches sequentially (ala quilt)
Signed-off-by: Eric Lesh <eclesh@ucla.edu>
---
 guilt-fork |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/guilt-fork b/guilt-fork
index 4ab55d7..ae31739 100755
--- a/guilt-fork
+++ b/guilt-fork
@@ -19,8 +19,12 @@ if ! must_commit_first; then
 	die "Uncommited changes detected. Refresh first."
 fi
 
-# FIXME: Be smarter about the new patchname (ala what quilt does)
-newpatch="$patch-2"
+# Rename patches smartly
+base=$(echo "$patch" \
+	| sed -r -e 's:(\.diff?|\.patch)$::')
+num=$(echo "$base" | sed -nre 's:.*-([0-9]+)$:\1:'p)
+[ -n "$num" ] || num=1
+newpatch="${base%-$num}-$((num+1))${patch#$base}"
 
 # copy the patch
 cp "$GUILT_DIR/$branch/$patch" "$GUILT_DIR/$branch/$newpatch"
-- 
1.5.1-rc1.GIT
Message 1 of 1 in “guilt-fork: Rename patches sequentially (ala quilt)”
  1. guilt-fork: Rename patches sequentially (ala quilt)Eric Lesh, Mar 28, 2007

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.