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

Re: git, monorepos, and access control

From
Jeff King <peff@peff.net>
Date
Dec 6, 2018, 09:30 UTC
Message-ID
<20181206093034.GC31335@sigill.intra.peff.net>
In-Reply-To
<8736rbypy3.fsf@evledraar.gmail.com>
On Thu, Dec 06, 2018 at 10:17:24AM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 21 quoted lines
> > The other major user of that feature I can think of is LFS. There Git
> > ends up diffing the LFS pointers, not the big files. Which arguably is
> > the wrong thing (you'd prefer to see the actual file contents diffed),
> > but I think nobody cares in practice because large files generally don't
> > have readable diffs anyway.
> 
> I don't use this either, but I can imagine people who use binary files
> via clean/smudge would be well served by dumping out textual metadata of
> the file for diffing instead of showing nothing.
> 
> E.g. for a video file I might imagine having lines like:
> 
>     duration-seconds: 123
>     camera-model: Shiny Thingamabob
> 
> Then when you check in a new file your "git diff" will show (using
> normal diff view) that:
> 
>    - duration-seconds: 123
>    + duration-seconds: 321
>     camera-model: Shiny Thingamabob

I think that's orthogonal to clean/smudge, though. Neither the in-repo nor on-disk formats are going to show that kind of output. For that you'd want a separate textconv filter (and fun fact: showing exif data was actually the original use case for which I wrote textconv).

If you are using something like LFS, using textconv on top is a little trickier, because we'd always feed the filter the LFS pointer file, not the actual data contents. Doing the "reversal" that Junio suggested would fix that. Or with the code as it is, you can simply define your filter to convert the LFS pointer data into the real content. I don't really use LFS, but it looks like:

  [diff "mp4"]
  textconv = git lfs smudge | extract-metadata
would probably work.
-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Johannes Schindelin
Message 13 of 17 in “git, monorepos, and access control”
  1. Coiner, JohnDec 5, 2018
  2. Ævar Arnfjörð BjarmasonDec 5, 2018
  3. Derrick StoleeDec 5, 2018
  4. Duy NguyenDec 5, 2018
  5. Ævar Arnfjörð BjarmasonDec 5, 2018
  6. Coiner, JohnDec 5, 2018
  7. Jeff KingDec 6, 2018
  8. Jeff KingDec 5, 2018
  9. brian m. carlsonDec 6, 2018
  10. Junio C HamanoDec 6, 2018
  11. Jeff KingDec 6, 2018
  12. Ævar Arnfjörð BjarmasonDec 6, 2018
  13. Jeff KingDec 6, 2018
  14. Johannes SchindelinDec 6, 2018
  15. Stefan BellerDec 6, 2018
  16. Coiner, JohnDec 6, 2018
  17. Ævar Arnfjörð BjarmasonDec 5, 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.