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

[PATCH] git-rebase--interactive.sh: add config option for custom

From
Michael Rappazzo <rappazzo@gmail.com>
Date
Jun 8, 2015, 00:53 UTC
Message-ID
<0000014dd0a821f6-a4ffca2d-d242-4e96-aeec-7a52186c5df1-000000@eu-west-1.amazonses.com>

A config option 'rebase.instructionFormat' can override the default 'oneline' format of the rebase instruction list.

Since the list is parsed using the left, right or boundary mark plus the sha1, they are prepended to the instruction format.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
---
 git-rebase--interactive.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index dc3133f..cc79b81 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -977,7 +977,14 @@ else
 	revisions=$onto...$orig_head
 	shortrevisions=$shorthead
 fi
-git rev-list $merges_option --pretty=oneline --reverse --left-right --topo-order \
+format=$(git config --get rebase.instructionFormat)
+if test -z "$format"
+then
+   format="%s"
+fi
+# the 'rev-list .. | sed' requires %m to parse; the instruction requires %h to parse
+format="%m%h ${format}"
+git rev-list $merges_option --pretty="${format}" --reverse --left-right --topo-order \
 	$revisions ${restrict_revision+^$restrict_revision} | \
 	sed -n "s/^>//p" |
 while read -r sha1 rest

---
https://github.com/git/git/pull/146
Next: Junio C Hamano
Message 1 of 4 in “git-rebase--interactive.sh: add config option for custom”
  1. git-rebase--interactive.sh: add config option for customMichael Rappazzo, Jun 8, 2015
  2. Junio C HamanoJun 8, 2015
  3. Mike RappazzoJun 8, 2015
  4. Junio C HamanoJun 8, 2015

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.