Skip to content

Commit f79c73c

Browse files
dschoJunio C Hamano
authored andcommitted
git-tag: support -F <file> option
This imitates the behaviour of git-commit. Noticed by Han-Wen Nienhuys. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 9e11554 commit f79c73c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Documentation/git-tag.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ git-tag - Create a tag object signed with GPG
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git-tag' [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <name> [<head>]
12+
'git-tag' [-a | -s | -u <key-id>] [-f | -d] [-m <msg> | -F <file>]
13+
<name> [<head>]
1314
'git-tag' -l [<pattern>]
1415

1516
DESCRIPTION
@@ -60,6 +61,9 @@ OPTIONS
6061
-m <msg>::
6162
Use the given tag message (instead of prompting)
6263

64+
-F <file>::
65+
Take the tag message from the given file. Use '-' to
66+
read the message from the standard input.
6367

6468
Author
6569
------

git-tag.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ do
4545
message_given=1
4646
fi
4747
;;
48+
-F)
49+
annotate=1
50+
shift
51+
if test "$#" = "0"; then
52+
die "error: option -F needs an argument"
53+
exit 2
54+
else
55+
message="$(cat "$1")"
56+
message_given=1
57+
fi
58+
;;
4859
-u)
4960
annotate=1
5061
signed=1

0 commit comments

Comments
 (0)