public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* UI: git-tag should support -F as well
@ 2006-12-21 11:52 Han-Wen Nienhuys
  2006-12-21 14:13 ` [PATCH] git-tag: support -F <file> option Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-21 11:52 UTC (permalink / raw)
  To: git


Working on a little darcs2git script, I found the following inconsistency

git-commit supports -m and -F 
git-tag supports only -m


-- 
 Han-Wen Nienhuys - hanwen@xs4all•nl - http://www.xs4all.nl/~hanwen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] git-tag: support -F <file> option
  2006-12-21 11:52 UI: git-tag should support -F as well Han-Wen Nienhuys
@ 2006-12-21 14:13 ` Johannes Schindelin
  2006-12-22  6:47   ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2006-12-21 14:13 UTC (permalink / raw)
  To: Han-Wen Nienhuys; +Cc: git


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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-tag: support -F <file> option
  2006-12-21 14:13 ` [PATCH] git-tag: support -F <file> option Johannes Schindelin
@ 2006-12-22  6:47   ` Junio C Hamano
  2006-12-22  6:53     ` Shawn Pearce
  2006-12-22 12:15     ` Johannes Schindelin
  0 siblings, 2 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-12-22  6:47 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Han-Wen Nienhuys, git

Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:

> This imitates the behaviour of git-commit.
>
> Noticed by Han-Wen Nienhuys.
>
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx•de>

Ok, but what the **** is "die ...; exit 2" sequence?

> @@ -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
> +	;;

I know it was copied from Han-Wen's aabd7693, but was this
somehow to catch the case where die can fail???

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-tag: support -F <file> option
  2006-12-22  6:47   ` Junio C Hamano
@ 2006-12-22  6:53     ` Shawn Pearce
  2006-12-22 12:15     ` Johannes Schindelin
  1 sibling, 0 replies; 5+ messages in thread
From: Shawn Pearce @ 2006-12-22  6:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Han-Wen Nienhuys, git

Junio C Hamano <junkio@cox•net> wrote:
> > +	if test "$#" = "0"; then
> > +	    die "error: option -F needs an argument"
> > +	    exit 2
> > +	;;
> 
> I know it was copied from Han-Wen's aabd7693, but was this
> somehow to catch the case where die can fail???

What, you haven't heard of the /bin/resurrection shell?

Apparently one of its features is it can sometimes make die return
successfully, even days after the initial call.  :-)

-- 
Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-tag: support -F <file> option
  2006-12-22  6:47   ` Junio C Hamano
  2006-12-22  6:53     ` Shawn Pearce
@ 2006-12-22 12:15     ` Johannes Schindelin
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2006-12-22 12:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys, git

Hi,

On Thu, 21 Dec 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:
> 
> > This imitates the behaviour of git-commit.
> >
> > Noticed by Han-Wen Nienhuys.
> >
> > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx•de>
> 
> Ok, but what the **** is "die ...; exit 2" sequence?

;-) I did not even bother reading the code when I copied it.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-22 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-21 11:52 UI: git-tag should support -F as well Han-Wen Nienhuys
2006-12-21 14:13 ` [PATCH] git-tag: support -F <file> option Johannes Schindelin
2006-12-22  6:47   ` Junio C Hamano
2006-12-22  6:53     ` Shawn Pearce
2006-12-22 12:15     ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox