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

[PATCH v3 1/2] rebase -i: remove get_author_ident_from_commit() from "git-sh-setup.sh"

From
Christian Couder <chriscool@tuxfamily.org>
Date
Jun 22, 2009, 04:28 UTC
Message-ID
<20090622042831.3858.65608.chriscool@tuxfamily.org>

The "get_author_ident_from_commit" function is only used in "git-rebase--interactive.sh" so there is no need for this function to be in "git-sh-setup.sh" anymore.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-rebase--interactive.sh |   27 +++++++++++++++++++++++++++
 git-sh-setup.sh            |   27 ---------------------------
 2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index f96d887..92e2523 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -116,6 +116,33 @@ mark_action_done () {
 	fi
 }
 
+get_author_ident_from_commit () {
+	pick_author_script='
+	/^author /{
+		s/'\''/'\''\\'\'\''/g
+		h
+		s/^author \([^<]*\) <[^>]*> .*$/\1/
+		s/'\''/'\''\'\'\''/g
+		s/.*/GIT_AUTHOR_NAME='\''&'\''/p
+
+		g
+		s/^author [^<]* <\([^>]*\)> .*$/\1/
+		s/'\''/'\''\'\'\''/g
+		s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p
+
+		g
+		s/^author [^<]* <[^>]*> \(.*\)$/\1/
+		s/'\''/'\''\'\'\''/g
+		s/.*/GIT_AUTHOR_DATE='\''&'\''/p
+
+		q
+	}
+	'
+	encoding=$(git config i18n.commitencoding || echo UTF-8)
+	git show -s --pretty=raw --encoding="$encoding" "$1" -- |
+	LANG=C LC_ALL=C sed -ne "$pick_author_script"
+}
+
 make_patch () {
 	sha1_and_parents="$(git rev-list --parents -1 "$1")"
 	case "$sha1_and_parents" in
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 80acb7d..b4624c5 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -131,33 +131,6 @@ require_work_tree () {
 	die "fatal: $0 cannot be used without a working tree."
 }
 
-get_author_ident_from_commit () {
-	pick_author_script='
-	/^author /{
-		s/'\''/'\''\\'\'\''/g
-		h
-		s/^author \([^<]*\) <[^>]*> .*$/\1/
-		s/'\''/'\''\'\'\''/g
-		s/.*/GIT_AUTHOR_NAME='\''&'\''/p
-
-		g
-		s/^author [^<]* <\([^>]*\)> .*$/\1/
-		s/'\''/'\''\'\'\''/g
-		s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p
-
-		g
-		s/^author [^<]* <[^>]*> \(.*\)$/\1/
-		s/'\''/'\''\'\'\''/g
-		s/.*/GIT_AUTHOR_DATE='\''&'\''/p
-
-		q
-	}
-	'
-	encoding=$(git config i18n.commitencoding || echo UTF-8)
-	git show -s --pretty=raw --encoding="$encoding" "$1" -- |
-	LANG=C LC_ALL=C sed -ne "$pick_author_script"
-}
-
 # Make sure we are in a valid repository of a vintage we understand,
 # if we require to be in a git repository.
 if test -z "$NONGIT_OK"
-- 
1.6.3.GIT
Message 1 of 1 in “rebase -i: remove get_author_ident_from_commit() from "git-sh-setup.sh"”
  1. 1/2 rebase -i: remove get_author_ident_from_commit() from "git-sh-setup.sh"Christian Couder, Jun 22, 2009

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.