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

Re: [PATCH] rev-parse --show-prefix: add in trailing newline

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 10, 2012, 17:56 UTC
Message-ID
<7vty0rpj2i.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120410173616.GA4300@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 18 quoted lines
> (cc-ing Duy)
> Hi,
>
> Ross Lagerwall wrote:
>
>> --- a/builtin/rev-parse.c
>> +++ b/builtin/rev-parse.c
>> @@ -634,6 +634,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
>>  			if (!strcmp(arg, "--show-prefix")) {
>>  				if (prefix)
>>  					puts(prefix);
>> +				else
>> +					putchar('\n');
>>  				continue;
>
> This makes the output more consistent but it is a little puzzling how
> it does that.  Why is prefix NULL instead of "" when we are at the
> toplevel of the worktree?
Interesting point ;-)
Previous: Jonathan NiederNext: Nguyen Thai Ngoc Duy
Message 8 of 9 in “rev-parse --show-prefix: add in trailing newline”
  1. rev-parse --show-prefix: add in trailing newlineRoss Lagerwall, Apr 9, 2012
  2. Junio C HamanoApr 9, 2012
  3. Ross LagerwallApr 10, 2012
  4. Jonathan NiederApr 10, 2012
  5. Andreas SchwabApr 10, 2012
  6. Junio C HamanoApr 10, 2012
  7. Jonathan NiederApr 10, 2012
  8. Junio C HamanoApr 10, 2012
  9. Nguyen Thai Ngoc DuyApr 10, 2012

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.