threads / patch / 14651

patchdocument that git-tag can tag more than heads

Subject: [PATCH] document that git-tag can tag more than heads

## tl;dr

3 messages between Jul 24, 2008 and Jul 24, 2008. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Jonathan Nieder· Jul 24, 2008, 05:01 UTC · lore

After looking the git-tag manpage, someone on #git wondered how to tag a commit that is not a branch head. This patch changes the synopsis to say "<commit-ish> | <object>" instead of "<head>" to address his question.

Samuel Bronson had the idea of putting "<commit-ish> | <object>" for "<object>" because most tags point to commits (and for the rest of the manpage, all tags point to commits).

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
---
 Documentation/git-tag.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to Documentation/git-tag.txt +2 −1
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index b8dc88f..1ce1d7d 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -9,7 +9,8 @@ git-tag - Create, list, delete or verify a tag object signed with GPG
 SYNOPSIS
 --------
 [verse]
-'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]  <name> [<head>]
+'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]
+	<name> [<commit-ish> | <object>]
 'git tag' -d <name>...
 'git tag' [-n[<num>]] -l [<pattern>]
 'git tag' -v <name>...
-- 
1.5.6.3.549.g8ca11
Kalle Olavi Niemitalo· Jul 24, 2008, 08:48 UTC · re: Jonathan Nieder · lore

Re: [PATCH] document that git-tag can tag more than heads

Jonathan Nieder <jrnieder@uchicago.edu> writes:
> Samuel Bronson had the idea of putting "<commit-ish> | <object>"
> for "<object>" because most tags point to commits (and for the
> rest of the manpage, all tags point to commits).
But the argument is not a <commit-ish>.  git.txt says:
        A command that takes a <commit-ish> argument ultimately
	wants to operate on a <commit> object but automatically
	dereferences <tag> objects that point at a <commit>.

git-tag does not automatically dereference tag objects that point to a commit. So if you want to use "|", then it should be "<commit> | <object>".

Jonathan Nieder· Jul 24, 2008, 16:55 UTC · re: Kalle Olavi Niemitalo · lore

[PATCH v2] document that git-tag can tag more than heads

After looking the git-tag manpage, someone on #git wondered how to tag a commit that is not a branch head. This patch changes the synopsis to say "<commit> | <object>" instead of "<head>" to address his question.

Samuel Bronson had the idea of putting "<commit> | <object>" for "<object>" because most tags point to commits (and for the rest of the manpage, all tags point to commits).

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
---
 Kalle Olavi Niemitalo wrote:
 > git-tag does not automatically dereference tag objects that
 > point to a commit.  So if you want to use "|", then it should be
 > "<commit> | <object>".
 Nice catch -- thanks.
 Documentation/git-tag.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to Documentation/git-tag.txt +2 −1
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index b8dc88f..046ab35 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -9,7 +9,8 @@ git-tag - Create, list, delete or verify a tag object signed with GPG
 SYNOPSIS
 --------
 [verse]
-'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]  <name> [<head>]
+'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]
+	<name> [<commit> | <object>]
 'git tag' -d <name>...
 'git tag' [-n[<num>]] -l [<pattern>]
 'git tag' -v <name>...
-- 
1.5.6.3.549.g8ca11

← back to recent threads