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

[PATCH] git-tag: support -F <file> option

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 21, 2006, 14:13 UTC
Message-ID
<Pine.LNX.4.63.0612211512160.19693@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<emdsi9$ecm$1@sea.gmane.org>
This imitates the behaviour of git-commit.
Noticed by Han-Wen Nienhuys.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	On Thu, 21 Dec 2006, Han-Wen Nienhuys wrote:
	> Working on a little darcs2git script, I found the following 
	> inconsistency
	> 
	> git-commit supports -m and -F 
	> git-tag supports only -m
	How about this?
 Documentation/git-tag.txt |    6 +++++-
 git-tag.sh                |   11 +++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index 45476c2..48b82b8 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -9,7 +9,8 @@ git-tag - Create a tag object signed with GPG
 SYNOPSIS
 --------
 [verse]
-'git-tag' [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <name> [<head>]
+'git-tag' [-a | -s | -u <key-id>] [-f | -d] [-m <msg> | -F <file>]
+	 <name> [<head>]
 'git-tag' -l [<pattern>]
 
 DESCRIPTION
@@ -60,6 +61,9 @@ OPTIONS
 -m <msg>::
 	Use the given tag message (instead of prompting)
 
+-F <file>::
+	Take the tag message from the given file.  Use '-' to
+	read the message from the standard input.
 
 Author
 ------
diff --git a/git-tag.sh b/git-tag.sh
index d53f94c..36cd6aa 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -45,6 +45,17 @@ do
 	    message_given=1
 	fi
 	;;
+    -F)
+	annotate=1
+	shift
+	if test "$#" = "0"; then
+	    die "error: option -F needs an argument"
+	    exit 2
+	else
+	    message="$(cat "$1")"
+	    message_given=1
+	fi
+	;;
     -u)
 	annotate=1
 	signed=1
-- 
1.4.4.3.g0ba4
Previous: Han-Wen NienhuysNext: Junio C Hamano
Message 2 of 5 in “UI: git-tag should support -F as well”
  1. Han-Wen NienhuysDec 21, 2006
  2. git-tag: support -F <file> optionJohannes Schindelin, Dec 21, 2006
  3. Junio C HamanoDec 22, 2006
  4. Shawn PearceDec 22, 2006
  5. Johannes SchindelinDec 22, 2006

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.