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

RE: [Best Practices Request] clean/smudge configuration

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
May 9, 2018, 22:57 UTC
Message-ID
<006201d3e7e9$17c1a800$4744f800$@nexbridge.com>
In-Reply-To
<CAGyf7-GJgpCZ=wEorLxYOm_ABaDamWKkTnOtaAwti35DJ_zS7g@mail.gmail.com>
On May 9, 2018 6:39 PM, Bryan Turner wrote
Show 20 quoted lines
> 
> On Wed, May 9, 2018 at 3:09 PM Randall S. Becker
> <rsbecker@nexbridge.com>
> wrote:
> 
> > The question: what is the best practice for versioning the parts of
> > clean/smudge filters that are in .git/config given that only some
> > users in my environment will be cloning the repository in question and
> > that I
> really
> > can't put the entries in /etc/gitconfig or ~/.gitconfig because of
> potential
> > conflicts with other repositories that might also have clean/smudge
> > definitions.
> 
> Depending on level of trust, one approach might be to use an [include] in
> .git/config to include a file that's in the repository. Something like:
> 
> [include]
>      path = ../path/to/config
It's a possibility, but I don't like the implications. Files that are subject to the clean/smudge would need to be reprocessed manually. In the scenario:
1. A checkout is done, changing ../path/to/config.
2. The clean/smudge configuration changes in ../path/to/config, but the files impacted by it do not.
3. git does not look like it would not be aware of the change until after the checkout, which is too late.
4. The work tree is now inconsistent with the idempotency of the clean/smudge rules, basically because nothing happened. (not blaming git here, just timing).
As far as I understand, this is a bit of a chicken-and-egg problem because the clean/smudge config needs to be there before the checkout. Correct?

Cheers, Randall

Previous: Bryan TurnerNext: Randall S. Becker
Message 3 of 6 in “[Best Practices Request] clean/smudge configuration”
  1. Randall S. BeckerMay 9, 2018
  2. Bryan TurnerMay 9, 2018
  3. Randall S. BeckerMay 9, 2018
  4. Randall S. BeckerMay 10, 2018
  5. Junio C HamanoMay 11, 2018
  6. Randall S. BeckerMay 11, 2018

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.