git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t1304: Set LOGNAME even if USER is unset or null

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 20, 2014, 18:34 UTC
Message-ID
<xmqqk33u380g.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141020152809.GR17200@odin.tremily.us>
"W. Trevor King" <wking@tremily.us> writes:
Show 20 quoted lines
> On Sun, Oct 19, 2014 at 03:49:36PM -0700, Junio C Hamano wrote:
>> I'll queue this as-is, but it makes me wonder if we want to do this
>> without if/then/fi, e.g.
>> 
>> 	: ${LOGNAME:=${USER:-$(id -u -n)}
>
> I'm fine with that too.
>
>> Spelling everything out with if/then/fi is obviously at the other
>> extreme, i.e.
>
> And I'm fine with this ;).
>
>> More importantly, what if none of the alternatives work?  I
>> personally feel it is OK to punt and declare test_done early,
>> instead of giving false positive breakages like you saw without this
>> patch.
>
> I can put this into a v2 if you like.  Which conditional syntax do you
> prefer?
Probably
    if test -z "$LOGNAME"
    then
            LOGNAME="${USER:-$(id -u -n)}"
    else
            : cannot test acl operations without a usable user name
            test_punt!
    fi
Previous: W. Trevor King
Message 4 of 4 in “t1304: Set LOGNAME even if USER is unset or null”
  1. t1304: Set LOGNAME even if USER is unset or nullW. Trevor King, Oct 17, 2014
  2. Junio C HamanoOct 19, 2014
  3. W. Trevor KingOct 20, 2014
  4. Junio C HamanoOct 20, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.