Skip to content

Commit

Permalink
Make git tag a builtin.
Browse files Browse the repository at this point in the history
This replaces the script "git-tag.sh" with "builtin-tag.c".

The existing test suite for "git tag" guarantees the compatibility
with the features provided by the script version.

There are some minor changes in the behaviour of "git tag" here:
"git tag -v" now can get more than one tag to verify, like "git tag -d" does,
"git tag" with no arguments prints all tags, more like "git branch" does,
and "git tag -n" also prints all tags with annotations (without needing -l).
Tests and documentation were also updated to reflect these changes.

The program is currently calling the script "git verify-tag" for verify.
This can be changed porting it to C and calling its functions directly
from builtin-tag.c.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Carlos Rica authored and Junio C Hamano committed Jul 20, 2007
1 parent 69a9b41 commit 62e09ce
Show file tree
Hide file tree
Showing 7 changed files with 538 additions and 13 deletions.
8 changes: 5 additions & 3 deletions Documentation/git-tag.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SYNOPSIS
'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <name> [<head>]
'git-tag' -d <name>...
'git-tag' [-n [<num>]] -l [<pattern>]
'git-tag' -v <name>
'git-tag' -v <name>...

DESCRIPTION
-----------
Expand All @@ -23,7 +23,7 @@ Unless `-f` is given, the tag must not yet exist in

If one of `-a`, `-s`, or `-u <key-id>` is passed, the command
creates a 'tag' object, and requires the tag message. Unless
`-m <msg>` is given, an editor is started for the user to type
`-m <msg>` or `-F <file>` is given, an editor is started for the user to type
in the tag message.

Otherwise just the SHA1 object name of the commit object is
Expand Down Expand Up @@ -59,15 +59,17 @@ OPTIONS
Delete existing tags with the given names.

-v::
Verify the gpg signature of given the tag
Verify the gpg signature of the given tag names.

-n <num>::
<num> specifies how many lines from the annotation, if any,
are printed when using -l.
The default is not to print any annotation lines.
If no number is given to `-n`, only the first line is printed.

-l <pattern>::
List tags with names that match the given pattern (or all if no pattern is given).
Typing "git tag" without arguments, also lists all tags.

-m <msg>::
Use the given tag message (instead of prompting)
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ SCRIPT_SH = \
git-pull.sh git-rebase.sh git-rebase--interactive.sh \
git-repack.sh git-request-pull.sh git-reset.sh \
git-sh-setup.sh \
git-tag.sh git-verify-tag.sh \
git-verify-tag.sh \
git-am.sh \
git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
git-merge-resolve.sh git-merge-ours.sh \
Expand Down Expand Up @@ -361,6 +361,7 @@ BUILTIN_OBJS = \
builtin-show-branch.o \
builtin-stripspace.o \
builtin-symbolic-ref.o \
builtin-tag.o \
builtin-tar-tree.o \
builtin-unpack-objects.o \
builtin-update-index.o \
Expand Down
Loading

0 comments on commit 62e09ce

Please sign in to comment.