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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Matthew Boeh <m@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]