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

Re: [PATCH] RFC: Introduce '.gitorderfile'

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 12, 2017, 21:03 UTC
Message-ID
<878tjtz7uc.fsf@gmail.com>
In-Reply-To
<xmqqinix1j29.fsf@gitster.mtv.corp.google.com>
On Wed, Jul 12 2017, Junio C. Hamano jotted:
Show 17 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>>   I want to force myself to think about the design before pointing out
>>   memory leaks and coding style, so the least I would wish for is:
>>     *.h
>>     *.c
>>   but as we have more to look at, I would want to have the most abstract
>>   thing to come first. And most abstract from the actual code is the
>>   user interaction, the documentation.
>
> This is exactly why I invented the orderfile in the first place.
> But such a "policy" is not something a project would want to enforce
> its users all the time; it is left to personal preference of the
> participants.
>
> Just set diff.orderFile to suit your taste without bothering other
> people, I would say.

I very much like Stefan's approach here[1]. It's very useful to be able to set something like this in a config on a project-wide basis, so that wherever patches are reviewed (in Gitweb, Git[hub|lab], git-format-patch etc.) they look as the project prefers.

As Stefan points out we're already accomplishing this with Documentation as a result of a hack.

But I see why you'd be concerned about this. If you're looking at random git repos there's a limit to what we'd like to allow them to customize without causing confusion. The diff order is relatively innocent, but you might make the case that other diff settings should be adjusted too (e.g. -U0 on certain file types), and that's quite the rabbit hole.

Still, I think this is innocuous enough to stright the right balance between intrusion and usability. Some would find this *very* useful, think projects that for whatever reason need to commit e.g. verbose XML config along with their code, and the framework they're using happens to rely on conf/ and src/ directories.

1. Although nit: let's call it .gitorder not .gitorderfile, that it's a
   file is implicit. We don't have .gitignorefile, .gitattributesfile
   etc.
Previous: Stefan Beller
Message 16 of 16 in “RFC: Introduce '.gitorderfile'”
  1. RFC: Introduce '.gitorderfile'Stefan Beller, Jul 11, 2017
  2. Junio C HamanoJul 12, 2017
  3. Jeff KingJul 12, 2017
  4. Stefan BellerJul 12, 2017
  5. Jeff KingJul 13, 2017
  6. Stefan BellerJul 13, 2017
  7. Brandon WilliamsJul 13, 2017
  8. Junio C HamanoJul 13, 2017
  9. Stefan BellerJul 13, 2017
  10. Junio C HamanoJul 13, 2017
  11. Junio C HamanoJul 12, 2017
  12. Jeff KingJul 13, 2017
  13. Stefan BellerJul 12, 2017
  14. Junio C HamanoJul 12, 2017
  15. Stefan BellerJul 12, 2017
  16. Ævar Arnfjörð BjarmasonJul 12, 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.