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

Re: [PATCH 3/3] diff: use skip_to_opt_val()

From
Christian Couder <christian.couder@gmail.com>
Date
Dec 7, 2017, 06:26 UTC
Message-ID
<CAP8UFD3H3PGqFyQoNwwi9ZA2_WM7Q_3pikbmEOnLLHfD4k4ahA@mail.gmail.com>
In-Reply-To
<CA+P7+xpeBsH4QGmv-m2i4RQ7DdZ9pMnpHmFi_=akDkg0CTj+pg@mail.gmail.com>
On Thu, Dec 7, 2017 at 1:18 AM, Jacob Keller <jacob.keller@gmail.com> wrote:
Show 13 quoted lines
> On Wed, Dec 6, 2017 at 4:16 PM, Jacob Keller <jacob.keller@gmail.com> wrote:
>>
>> This causes a regression in the --relative option which prevents it
>> from working properly.
>>
>> If I have a repository with a modified file in a subdirectory, such as:
>>
>> a/file
>>
>> then git diff-index --relative --name-only HEAD from within "a" will
>> return "a/file" instead of "file"
>>
>> This breaks git completion, (among other things).
Ok, thanks for the report. I will fix that.
> I believe this occurs because skip_to_optional_val overwrites the arg
> even if it's not there, and the --relative argument expects prefix to
> remain unchanged if the optional value is not provided.
Yeah, that makes sense.
Previous: Jacob KellerNext: Junio C Hamano
Message 6 of 11 in “git-compat-util: introduce skip_to_opt_val()”
  1. 1/3 git-compat-util: introduce skip_to_opt_val()Christian Couder, Dec 3, 2017
  2. 2/3 index-pack: use skip_to_opt_val()Christian Couder, Dec 3, 2017
  3. 3/3 diff: use skip_to_opt_val()Christian Couder, Dec 3, 2017
  4. Jacob KellerDec 7, 2017
  5. Jacob KellerDec 7, 2017
  6. Christian CouderDec 7, 2017
  7. Junio C HamanoDec 3, 2017
  8. Christian CouderDec 3, 2017
  9. Junio C HamanoDec 3, 2017
  10. Christian CouderDec 4, 2017
  11. Junio C HamanoDec 4, 2017

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.