Skip to content

Commit 55d1932

Browse files
committed
Merge branch 'cr/tag'
* cr/tag: Teach "git stripspace" the --strip-comments option Make verify-tag a builtin. builtin-tag.c: Fix two memory leaks and minor notation changes. launch_editor(): Heed GIT_EDITOR and core.editor settings Make git tag a builtin.
2 parents 98e79f6 + f653aee commit 55d1932

File tree

16 files changed

+720
-17
lines changed

16 files changed

+720
-17
lines changed

Documentation/git-stripspace.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ git-stripspace - Filter out empty lines
88

99
SYNOPSIS
1010
--------
11-
'git-stripspace' < <stream>
11+
'git-stripspace' [-s | --strip-comments] < <stream>
1212

1313
DESCRIPTION
1414
-----------
1515
Remove multiple empty lines, and empty lines at beginning and end.
1616

1717
OPTIONS
1818
-------
19+
-s\|--strip-comments::
20+
In addition to empty lines, also strip lines starting with '#'.
21+
1922
<stream>::
2023
Byte stream to act on.
2124

Documentation/git-tag.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SYNOPSIS
1212
'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <name> [<head>]
1313
'git-tag' -d <name>...
1414
'git-tag' [-n [<num>]] -l [<pattern>]
15-
'git-tag' -v <name>
15+
'git-tag' -v <name>...
1616

1717
DESCRIPTION
1818
-----------
@@ -23,7 +23,7 @@ Unless `-f` is given, the tag must not yet exist in
2323

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

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

6161
-v::
62-
Verify the gpg signature of given the tag
62+
Verify the gpg signature of the given tag names.
6363

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

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

7274
-m <msg>::
7375
Use the given tag message (instead of prompting)

Documentation/git-verify-tag.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ git-verify-tag(1)
33

44
NAME
55
----
6-
git-verify-tag - Check the GPG signature of tag
6+
git-verify-tag - Check the GPG signature of tags
77

88
SYNOPSIS
99
--------
10-
'git-verify-tag' <tag>
10+
'git-verify-tag' <tag>...
1111

1212
DESCRIPTION
1313
-----------

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ SCRIPT_SH = \
208208
git-pull.sh git-rebase.sh git-rebase--interactive.sh \
209209
git-repack.sh git-request-pull.sh git-reset.sh \
210210
git-sh-setup.sh \
211-
git-tag.sh git-verify-tag.sh \
212211
git-am.sh \
213212
git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
214213
git-merge-resolve.sh git-merge-ours.sh \
@@ -363,12 +362,14 @@ BUILTIN_OBJS = \
363362
builtin-show-branch.o \
364363
builtin-stripspace.o \
365364
builtin-symbolic-ref.o \
365+
builtin-tag.o \
366366
builtin-tar-tree.o \
367367
builtin-unpack-objects.o \
368368
builtin-update-index.o \
369369
builtin-update-ref.o \
370370
builtin-upload-archive.o \
371371
builtin-verify-pack.o \
372+
builtin-verify-tag.o \
372373
builtin-write-tree.o \
373374
builtin-show-ref.o \
374375
builtin-pack-refs.o

builtin-stripspace.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
7676
{
7777
char *buffer;
7878
unsigned long size;
79+
int strip_comments = 0;
80+
81+
if (argc > 1 && (!strcmp(argv[1], "-s") ||
82+
!strcmp(argv[1], "--strip-comments")))
83+
strip_comments = 1;
7984

8085
size = 1024;
8186
buffer = xmalloc(size);
@@ -84,7 +89,7 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
8489
die("could not read the input");
8590
}
8691

87-
size = stripspace(buffer, size, 0);
92+
size = stripspace(buffer, size, strip_comments);
8893
write_or_die(1, buffer, size);
8994
if (size)
9095
putc('\n', stdout);

0 commit comments

Comments
 (0)