Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1563991 > unrolled thread
| Started by | xufeng <xufwang@163.com> |
|---|---|
| First post | 2017-01-21 00:30 +0100 |
| Last post | 2017-01-22 03:30 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] setlocalversion: fix error detectition of kernel git repository xufeng <xufwang@163.com> - 2017-01-21 00:30 +0100
Re: [PATCH] setlocalversion: fix error detectition of kernel git repository Nico Schottelius <nico-linuxsetlocalversion@schottelius.org> - 2017-01-21 22:20 +0100
Re:Re: [PATCH] setlocalversion: fix error detectition of kernel git repository xufeng <xufwang@163.com> - 2017-01-22 03:30 +0100
| From | xufeng <xufwang@163.com> |
|---|---|
| Date | 2017-01-21 00:30 +0100 |
| Subject | [PATCH] setlocalversion: fix error detectition of kernel git repository |
| Message-ID | <t1QN3-5bm-1@gated-at.bofh.it> |
This patch fixed the error using 'git rev-parse --show-cdup' to check that git is used as SCM to track the current directory. The return value of this command is not null string when the .git directory is not in kernel topdir. Signed-off-by: Xufeng Wang <xufwang@163.com> --- scripts/setlocalversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 966dd39..7966e39 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -43,7 +43,7 @@ scm_version() fi # Check for git and a git repo. - if test -z "$(git rev-parse --show-cdup 2>/dev/null)" && + if test -z "$(git rev-parse --show-cdup &>/dev/null)" && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore -- 2.9.3
[toc] | [next] | [standalone]
| From | Nico Schottelius <nico-linuxsetlocalversion@schottelius.org> |
|---|---|
| Date | 2017-01-21 22:20 +0100 |
| Subject | Re: [PATCH] setlocalversion: fix error detectition of kernel git repository |
| Message-ID | <t2beN-q7-3@gated-at.bofh.it> |
| In reply to | #1563991 |
Hello Xufeng, why do you think redirecting *all* output to /dev/null is the right thing todo? And which problem does it exactly fix? Do you see that there is a difference between a "return value" (i.e. exit code) and the output (in this case stdout) of a program? Best, Nico xufeng <xufwang@163.com> writes: > This patch fixed the error using 'git rev-parse --show-cdup' to check > that git is used as SCM to track the current directory. The return > value of this command is not null string when the .git directory is > not in kernel topdir. > > Signed-off-by: Xufeng Wang <xufwang@163.com> > --- > scripts/setlocalversion | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/setlocalversion b/scripts/setlocalversion > index 966dd39..7966e39 100755 > --- a/scripts/setlocalversion > +++ b/scripts/setlocalversion > @@ -43,7 +43,7 @@ scm_version() > fi > > # Check for git and a git repo. > -if test -z "$(git rev-parse --show-cdup 2>/dev/null)" && > +if test -z "$(git rev-parse --show-cdup &>/dev/null)" && > head=`git rev-parse --verify --short HEAD 2>/dev/null`; then > > # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore -- Werde Teil des modernen Arbeitens im Glarnerland auf www.digitalglarus.ch! Lese Neuigkeiten auf Twitter: www.twitter.com/DigitalGlarus Diskutiere mit auf Facebook: www.facebook.com/digitalglarus
[toc] | [prev] | [next] | [standalone]
| From | xufeng <xufwang@163.com> |
|---|---|
| Date | 2017-01-22 03:30 +0100 |
| Message-ID | <t2g4O-3bx-3@gated-at.bofh.it> |
| In reply to | #1564253 |
I'm sorry. My patch is error. But I just want to get the git version when we use git as SCM. No matter what .git directory where. Thanks. At 2017-01-22 04:54:54, "Nico Schottelius" <nico-linuxsetlocalversion@schottelius.org> wrote: > >Hello Xufeng, > >why do you think redirecting *all* output to /dev/null is the right >thing todo? > >And which problem does it exactly fix? > >Do you see that there is a difference between a "return value" >(i.e. exit code) and the output (in this case stdout) of a program? > >Best, > >Nico > >xufeng <xufwang@163.com> writes: > >> This patch fixed the error using 'git rev-parse --show-cdup' to check >> that git is used as SCM to track the current directory. The return >> value of this command is not null string when the .git directory is >> not in kernel topdir. >> >> Signed-off-by: Xufeng Wang <xufwang@163.com> >> --- >> scripts/setlocalversion | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/scripts/setlocalversion b/scripts/setlocalversion >> index 966dd39..7966e39 100755 >> --- a/scripts/setlocalversion >> +++ b/scripts/setlocalversion >> @@ -43,7 +43,7 @@ scm_version() >> fi >> >> # Check for git and a git repo. >> -if test -z "$(git rev-parse --show-cdup 2>/dev/null)" && >> +if test -z "$(git rev-parse --show-cdup &>/dev/null)" && >> head=`git rev-parse --verify --short HEAD 2>/dev/null`; then >> >> # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore > > >-- >Werde Teil des modernen Arbeitens im Glarnerland auf www.digitalglarus.ch! >Lese Neuigkeiten auf Twitter: www.twitter.com/DigitalGlarus >Diskutiere mit auf Facebook: www.facebook.com/digitalglarus
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web