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

Re: [PATCH] tests: drop dependency on `git diff` in check-chainlint

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2023, 16:49 UTC
Message-ID
<xmqqo7esohjm.fsf@gitster.g>
In-Reply-To
<ZXq3YdK2RSKF3npE@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 11 quoted lines
> This strongly reminds me of the thread at [1], where a similar issue was
> discussed for git-grep(1). Quoting Junio: 
>
>> I actually do not think these "we are allowing Git tools to be used
>> on random garbage" is a good idea to begin with X-<.  If we invented
>> something nice for our variant in "git grep" and wish we can use it
>> outside the repository, contributing the feature to implementations
>> of "grep" would have been the right way to move forward, instead of
>> contaminating the codebase with things that are not related to Git.
>
> So this might not be the best way to go.
That is not a conclusion I want people to draw.

Like it or not, "git diff --no-index" will be with us to stay, and "--no-index" being "we have abused the rest of Git code to implement 'diff' that works _outside_ a Git repository---now go and do your thing", we would eventually want to correct it, if it is misbehaving when a repository it finds is in a shape it does not like, no?

We should have what you quoted in mind as a general principle, and think twice when we are tempted to hoard useful features for another tool we initially wrote for Git and allow them to be used with the "--no-index" option, instead of contributing them to the tool that does not know or care "git" repositories (like "diff" and "grep").

Previous: Eric SunshineNext: Patrick Steinhardt
Message 4 of 5 in “tests: drop dependency on `git diff` in check-chainlint”
  1. tests: drop dependency on `git diff` in check-chainlintEric Sunshine, Dec 14, 2023
  2. Patrick SteinhardtDec 14, 2023
  3. Eric SunshineDec 14, 2023
  4. Junio C HamanoDec 14, 2023
  5. Patrick SteinhardtDec 15, 2023

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.