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

Re: [RFC PATCH] pack-refs: fail on falsely sorted packed-refs

From
Max Kirillov <max@max630.net>
Date
Feb 23, 2019, 07:09 UTC
Message-ID
<20190223070914.GC2354@jessie.local>
In-Reply-To
<87lg2kj91a.fsf@evledraar.gmail.com>
On Wed, Feb 13, 2019 at 11:08:01AM +0100, Ævar Arnfjörð Bjarmason wrote:
> You have an extra two whitespaces after "&&" there.
Thanks, will check it.
>> +	git commit --allow-empty -m commit &&
> Looks like just "test_commit A" would do here.

About this I'm not sure. AFAIK test_commit does lots of stuff, so can it be considered "just" compared to "commit --allow-empty" or the opposite? I could replace it with test_commit for uniformity reason though.

> We can fail in these sorts of loops. There's a few ways to deal with
> that. Doing it like this with "break" will still silently hide errors:
Thanks, this was pointed point
>> +	printf "$head_object refs/heads/b00\\n" >>.git/packed-refs &&
> 
> Looks like just "echo" here would be simpler since we only use printf to
> add a newline.

Could it happen so that "echo" adds '\r\n' at Windows? I could use echo.

> Instead of "! git ..." use "test_must_fail git ...". See t/README. This
> will hide e.g. segfaults.
Thanks, this was pointed point
Show 7 quoted lines
> Also, perhaps:
> 
>     test_must_fail git ... 2>stderr &&
>     grep "broken sorting in packed-refs" stderr
> 
> Would make this more obvious/self-documenting so we know we failed due
> to that issue in particular.
Thanks, will change it
Previous: Jeff KingNext: Max Kirillov
Message 11 of 12 in “pack-refs: fail on falsely sorted packed-refs”
  1. pack-refs: fail on falsely sorted packed-refsMax Kirillov, Jan 30, 2019
  2. Eric SunshineJan 30, 2019
  3. Max KirillovJan 31, 2019
  4. pack-refs: fail on falsely sorted packed-refsMax Kirillov, Feb 8, 2019
  5. Eric SunshineFeb 8, 2019
  6. Max KirillovFeb 13, 2019
  7. Ævar Arnfjörð BjarmasonFeb 13, 2019
  8. SZEDER GáborFeb 13, 2019
  9. Max KirillovFeb 23, 2019
  10. Jeff KingFeb 14, 2019
  11. Max KirillovFeb 23, 2019
  12. Max KirillovFeb 13, 2019

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.