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

[PATCH/RFC 1/2] Add sequence.format to interactive rebase

From
William Clifford <mr.william.clifford@gmail.com>
Date
Sep 5, 2014, 08:40 UTC
Message-ID
<861trli9lb.fsf@gmail.com>

Allow user to customize the format of commit table in interactive rebase todo file. Short hashes are still required to be the second column so these are added to the format if not already present. Defaults to oneline as before.

Signed-off-by: William Clifford <mr.william.clifford@gmail.com>
Signed-off-by: Matthew Boeh <m@mboeh.com>
---
 git-rebase--interactive.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index b64dd28..ba1f4b8 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -961,7 +961,19 @@ else
 	revisions=$onto...$orig_head
 	shortrevisions=$shorthead
 fi
-git rev-list $merges_option --pretty=oneline --abbrev-commit \
+
+if test -z "$GIT_SEQUENCE_FORMAT"
+then
+	GIT_SEQUENCE_FORMAT="$(git config sequence.format)"
+fi
+if test -n "$GIT_SEQUENCE_FORMAT"
+then
+	if test "$GIT_SEQUENCE_FORMAT" = "${GIT_SEQUENCE_FORMAT#>%h}"
+	then
+		GIT_SEQUENCE_FORMAT=">%h $GIT_SEQUENCE_FORMAT"
+	fi
+fi
+git rev-list $merges_option --pretty="${GIT_SEQUENCE_FORMAT:-oneline}" --abbrev-commit \
 	--abbrev=7 --reverse --left-right --topo-order \
 	$revisions ${restrict_revision+^$restrict_revision} | \
 	sed -n "s/^>//p" |
-- 
William Clifford
Message 1 of 1 in “Add sequence.format to interactive rebase”
  1. 1/2 Add sequence.format to interactive rebaseWilliam Clifford, Sep 5, 2014

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.