linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] setlocalversion: fix error detectition of kernel git repository
@ 2017-01-20 23:23 xufeng
  2017-01-21 20:54 ` Nico Schottelius
  0 siblings, 1 reply; 3+ messages in thread
From: xufeng @ 2017-01-20 23:23 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, nico-linuxsetlocalversion, wsa

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] setlocalversion: fix error detectition of kernel git repository
  2017-01-20 23:23 [PATCH] setlocalversion: fix error detectition of kernel git repository xufeng
@ 2017-01-21 20:54 ` Nico Schottelius
  2017-01-22  2:10   ` xufeng
  0 siblings, 1 reply; 3+ messages in thread
From: Nico Schottelius @ 2017-01-21 20:54 UTC (permalink / raw)
  To: xufeng; +Cc: linux-kbuild, linux-kernel, nico-linuxsetlocalversion, wsa


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:Re: [PATCH] setlocalversion: fix error detectition of kernel git repository
  2017-01-21 20:54 ` Nico Schottelius
@ 2017-01-22  2:10   ` xufeng
  0 siblings, 0 replies; 3+ messages in thread
From: xufeng @ 2017-01-22  2:10 UTC (permalink / raw)
  To: Nico Schottelius; +Cc: linux-kbuild, linux-kernel, wsa


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-22  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 23:23 [PATCH] setlocalversion: fix error detectition of kernel git repository xufeng
2017-01-21 20:54 ` Nico Schottelius
2017-01-22  2:10   ` xufeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).