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
23 hours ago
Which operating system, shell and git version?
– Jan Hudec
22 hours ago
@user3729611 What is the| head
part meant to achieve here?
– RomainValeri
20 hours ago
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 19 hours ago
asked 23 hours ago
user3729611
655
655
1
Both commands give the same output at my end.
– Mayank Porwal
23 hours ago
Which operating system, shell and git version?
– Jan Hudec
22 hours ago
@user3729611 What is the| head
part meant to achieve here?
– RomainValeri
20 hours ago
add a comment |
1
Both commands give the same output at my end.
– Mayank Porwal
23 hours ago
Which operating system, shell and git version?
– Jan Hudec
22 hours ago
@user3729611 What is the| head
part meant to achieve here?
– RomainValeri
20 hours ago
1
1
Both commands give the same output at my end.
– Mayank Porwal
23 hours ago
Both commands give the same output at my end.
– Mayank Porwal
23 hours ago
Which operating system, shell and git version?
– Jan Hudec
22 hours ago
Which operating system, shell and git version?
– Jan Hudec
22 hours ago
@user3729611 What is the
| head
part meant to achieve here?– RomainValeri
20 hours ago
@user3729611 What is the
| head
part meant to achieve here?– RomainValeri
20 hours ago
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 19 hours ago
answered 19 hours ago
ohlec
1,561717
1,561717
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
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
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
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
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
1
Both commands give the same output at my end.
– Mayank Porwal
23 hours ago
Which operating system, shell and git version?
– Jan Hudec
22 hours ago
@user3729611 What is the
| head
part meant to achieve here?– RomainValeri
20 hours ago