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

Re: Standardized escaping to store a .git in git?

From
Josh Triplett <josh@joshtriplett.org>
Date
May 20, 2021, 03:26 UTC
Message-ID
<YKXW/Elvf8l780Yp@localhost>
In-Reply-To
<YKWTGMw3nShH9VKt@google.com>
On Wed, May 19, 2021 at 03:37:12PM -0700, Jonathan Nieder wrote:
Show 15 quoted lines
> Josh Triplett wrote:
> > Part of my motivation, here, is that I'm looking to implement one such
> > escaping mechanism (in a tool built atop libgit2 that needs to handle
> > and version arbitrary files), and rather than inventing something
> > bespoke I'd love to interoperate. And since I've seen various approaches
> > used in the wild, I didn't want to add Yet Another distinct approach
> > before starting a design conversation about it.
>
> *nod* To be clear, I'm glad you brought it up, among other reasons
> because it means this discussion becomes available in the list archive
> for when people are wondering about the same thing in the future.
>
> > For the storing-arbitrary-files case, these wouldn't apply.
>
> Can you say a little more about the storing-arbitrary-files case?

Sure. I'm using git to record before-and-after states of running commands in an isolated environment, to see the differences caused by those commands. The "before" state includes everything the command needs, and the delta from "before" to "after" is exactly what the command changed. Some commands create git repositories; for instance, some software build scripts `git clone` their dependencies or other data. So when I go to record the "after" state, it might include a .git directory. And I need to record that as transparently as possible.

I'd like to use git repositories so that people *can* push and pull data using git, inspect the repository with things like "git show", use "git diff", and similar.

> There are some other filenames that "git fsck" also forbids, so this
> comes down to more than figuring out how to handle ".git".

Are you talking about the case-insensitive check for paths that can be confused with .git on some platforms, or something more than that?

Previous: Jonathan Nieder
Message 5 of 5 in “Standardized escaping to store a .git in git?”
  1. Josh TriplettMay 19, 2021
  2. Jonathan NiederMay 19, 2021
  3. Josh TriplettMay 19, 2021
  4. Jonathan NiederMay 19, 2021
  5. Josh TriplettMay 20, 2021

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.