All of lore.kernel.org
 help / color / mirror / Atom feed
From: Franck Bui-Huu <fbuihuu@gmail.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix detectition of kernel git repository in setlocalversion script
Date: Mon, 02 Dec 2013 16:23:10 +0100	[thread overview]
Message-ID: <529CA5DE.7030505@gmail.com> (raw)
In-Reply-To: <529CA44C.1030306@suse.cz>

On 12/02/2013 04:16 PM, Michal Marek wrote:
> On 2.12.2013 16:14, Franck Bui-Huu wrote:
>> On 12/02/2013 03:57 PM, Michal Marek wrote:
>>> On 2.12.2013 14:21, Franck Bui-Huu wrote:
>>>> diff --git a/scripts/setlocalversion b/scripts/setlocalversion
>>>> index 0b5ccf3..c16e65d 100755
>>>> --- a/scripts/setlocalversion
>>>> +++ b/scripts/setlocalversion
>>>> @@ -43,7 +43,8 @@ scm_version()
>>>>  	fi
>>>>  
>>>>  	# Check for git and a git repo.
>>>> -	if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
>>>> +	if topdir=$(git rev-parse --show-cdup 2>/dev/null) && test -z "$topdir" &&
>>>> +	   head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
>>>
>>> You can do test -z "$(git rev-parse --show-cdup 2>/dev/null)" without
>>> the $topdir variable.
>>
>> No, "$(git rev-parse --show-cdup 2>/dev/null)" would also give the empty
>> string if the git command fails (ie not inside a git repository at all).
> 
> Then git rev-parse will also fail.

Fair enough ;)

I'm resending a new patch.

Thanks.
-- 
            Franck

  reply	other threads:[~2013-12-02 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 13:21 [PATCH] Fix detectition of kernel git repository in setlocalversion script Franck Bui-Huu
2013-12-02 14:57 ` Michal Marek
2013-12-02 15:14   ` Franck Bui-Huu
2013-12-02 15:16     ` Michal Marek
2013-12-02 15:23       ` Franck Bui-Huu [this message]
2013-12-02 15:34         ` [PATCH] Fix detectition of kernel git repository in setlocalversion script [take #2] Franck Bui-Huu
2014-01-03 13:49           ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529CA5DE.7030505@gmail.com \
    --to=fbuihuu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.