How to capture the tags applied by git decorate
up vote
2
down vote
favorite
What goes on here? Why are the two outputs different?
$ git log --oneline -n1
7dbee6d (HEAD -> master, origin/master, origin/HEAD) some commit msg
$ git log --oneline -n1 | head
7dbee6d some commit msg
The piping to 'head' was the simplest example I could find to illustrate the problem. The problem prevents me from e.g.:
- Piping to a file including the git decoration
- Piping to "grep", e.g. to grep for certain tags
system:
- Ubuntu 18.04.1 LTS
- git version 2.17.1
- GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
git shell stdout
add a comment |
up vote
2
down vote
favorite
What goes on here? Why are the two outputs different?
$ git log --oneline -n1
7dbee6d (HEAD -> master, origin/master, origin/HEAD) some commit msg
$ git log --oneline -n1 | head
7dbee6d some commit msg
The piping to 'head' was the simplest example I could find to illustrate the problem. The problem prevents me from e.g.:
- Piping to a file including the git decoration
- Piping to "grep", e.g. to grep for certain tags
system:
- Ubuntu 18.04.1 LTS
- git version 2.17.1
- GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
git shell stdout
1
Both commands give the same output at my end.
– Mayank Porwal
Nov 9 at 7:17
Which operating system, shell and git version?
– Jan Hudec
Nov 9 at 7:43
@user3729611 What is the| head
part meant to achieve here?
– RomainValeri
Nov 9 at 9:37
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
What goes on here? Why are the two outputs different?
$ git log --oneline -n1
7dbee6d (HEAD -> master, origin/master, origin/HEAD) some commit msg
$ git log --oneline -n1 | head
7dbee6d some commit msg
The piping to 'head' was the simplest example I could find to illustrate the problem. The problem prevents me from e.g.:
- Piping to a file including the git decoration
- Piping to "grep", e.g. to grep for certain tags
system:
- Ubuntu 18.04.1 LTS
- git version 2.17.1
- GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
git shell stdout
What goes on here? Why are the two outputs different?
$ git log --oneline -n1
7dbee6d (HEAD -> master, origin/master, origin/HEAD) some commit msg
$ git log --oneline -n1 | head
7dbee6d some commit msg
The piping to 'head' was the simplest example I could find to illustrate the problem. The problem prevents me from e.g.:
- Piping to a file including the git decoration
- Piping to "grep", e.g. to grep for certain tags
system:
- Ubuntu 18.04.1 LTS
- git version 2.17.1
- GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
git shell stdout
git shell stdout
edited Nov 9 at 10:25
asked Nov 9 at 7:12
user3729611
655
655
1
Both commands give the same output at my end.
– Mayank Porwal
Nov 9 at 7:17
Which operating system, shell and git version?
– Jan Hudec
Nov 9 at 7:43
@user3729611 What is the| head
part meant to achieve here?
– RomainValeri
Nov 9 at 9:37
add a comment |
1
Both commands give the same output at my end.
– Mayank Porwal
Nov 9 at 7:17
Which operating system, shell and git version?
– Jan Hudec
Nov 9 at 7:43
@user3729611 What is the| head
part meant to achieve here?
– RomainValeri
Nov 9 at 9:37
1
1
Both commands give the same output at my end.
– Mayank Porwal
Nov 9 at 7:17
Both commands give the same output at my end.
– Mayank Porwal
Nov 9 at 7:17
Which operating system, shell and git version?
– Jan Hudec
Nov 9 at 7:43
Which operating system, shell and git version?
– Jan Hudec
Nov 9 at 7:43
@user3729611 What is the
| head
part meant to achieve here?– RomainValeri
Nov 9 at 9:37
@user3729611 What is the
| head
part meant to achieve here?– RomainValeri
Nov 9 at 9:37
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
From the log
manpage:
--decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is
specified, the ref name prefixes refs/heads/, refs/tags/ and
refs/remotes/ will not be printed. If full is specified, the full
ref name (including prefix) will be printed. If auto is specified,
then if the output is going to a terminal, the ref names are shown
as if short were given, otherwise no ref names are shown.
The default option is short.
So when called with --decorate=auto
, the behavior will change depending whether stdout is a terminal or not. If you pipe git log
output somewhere, stdout
will not be a terminal.
The default is short
, but you may have auto
somewhere in your git options.
To get the same behavior in both cases, call it with --decorate=short
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
From the log
manpage:
--decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is
specified, the ref name prefixes refs/heads/, refs/tags/ and
refs/remotes/ will not be printed. If full is specified, the full
ref name (including prefix) will be printed. If auto is specified,
then if the output is going to a terminal, the ref names are shown
as if short were given, otherwise no ref names are shown.
The default option is short.
So when called with --decorate=auto
, the behavior will change depending whether stdout is a terminal or not. If you pipe git log
output somewhere, stdout
will not be a terminal.
The default is short
, but you may have auto
somewhere in your git options.
To get the same behavior in both cases, call it with --decorate=short
add a comment |
up vote
1
down vote
accepted
From the log
manpage:
--decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is
specified, the ref name prefixes refs/heads/, refs/tags/ and
refs/remotes/ will not be printed. If full is specified, the full
ref name (including prefix) will be printed. If auto is specified,
then if the output is going to a terminal, the ref names are shown
as if short were given, otherwise no ref names are shown.
The default option is short.
So when called with --decorate=auto
, the behavior will change depending whether stdout is a terminal or not. If you pipe git log
output somewhere, stdout
will not be a terminal.
The default is short
, but you may have auto
somewhere in your git options.
To get the same behavior in both cases, call it with --decorate=short
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
From the log
manpage:
--decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is
specified, the ref name prefixes refs/heads/, refs/tags/ and
refs/remotes/ will not be printed. If full is specified, the full
ref name (including prefix) will be printed. If auto is specified,
then if the output is going to a terminal, the ref names are shown
as if short were given, otherwise no ref names are shown.
The default option is short.
So when called with --decorate=auto
, the behavior will change depending whether stdout is a terminal or not. If you pipe git log
output somewhere, stdout
will not be a terminal.
The default is short
, but you may have auto
somewhere in your git options.
To get the same behavior in both cases, call it with --decorate=short
From the log
manpage:
--decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is
specified, the ref name prefixes refs/heads/, refs/tags/ and
refs/remotes/ will not be printed. If full is specified, the full
ref name (including prefix) will be printed. If auto is specified,
then if the output is going to a terminal, the ref names are shown
as if short were given, otherwise no ref names are shown.
The default option is short.
So when called with --decorate=auto
, the behavior will change depending whether stdout is a terminal or not. If you pipe git log
output somewhere, stdout
will not be a terminal.
The default is short
, but you may have auto
somewhere in your git options.
To get the same behavior in both cases, call it with --decorate=short
edited Nov 9 at 10:44
answered Nov 9 at 10:39
ohlec
1,685717
1,685717
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53221274%2fhow-to-capture-the-tags-applied-by-git-decorate%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Both commands give the same output at my end.
– Mayank Porwal
Nov 9 at 7:17
Which operating system, shell and git version?
– Jan Hudec
Nov 9 at 7:43
@user3729611 What is the
| head
part meant to achieve here?– RomainValeri
Nov 9 at 9:37