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

RE: File Systems and a Theory of Edits

From
MNMichael Nahas <mike.nahas@gmail.com>
Date
Jul 31, 2011, 14:15 UTC
Message-ID
<CADo4Y9gECLJ45g_r-uZBRnfEVXBRw2EoF2HkRu=0-eJ2YCuBLA@mail.gmail.com>
In-Reply-To
<CADo4Y9gU_Z73gCPCESvVZhLOJUJg+mTqHkeqpNv2L8xLJvKxEQ@mail.gmail.com>

Rene, I don't doubt that there exists current commands in git that can perform operations like cat, ls, etc.  My point is that git can make it easier for new users to learn commands and existing users to remember commands if git copies the name and sematics (as much as possible) of cat, ls, etc.

Ævar, The issue is what goes inside the xargs command.  If it is unix's cat command, the files listed by find will be from the commit's snapshot, but the files read by cat will be from the working tree.

I believe the solution for xargs may be John D.'s solution - to "mount" the snapshot as a file system.  And the "mount" command in git is "git checkout".  (Now, I almost want to rename "git checkout" to "git remount"!)

Mike Nahas

On Sun, Jul 31, 2011 at 4:15 AM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 20 quoted lines
>
> Am 30.07.2011 21:06, schrieb Ævar Arnfjörð Bjarmason:
> > On Sat, Jul 30, 2011 at 16:29, Michael Nahas <mike.nahas@gmail.com> wrote:
> >>     "git xargs <commit> ..."  (Is this possible?)
> >
> > I don't have comments on the rest of your proposal, but I've often
> > wanted a git-find(1) similar to git-grep(1). Which would give you this
> > functionality.
> >
> > Then you could simply:
> >
> >     git find <commit> <path> -type f | xargs <whatever>
> >
> > Or something like that.
>
> How about this, which should match your example:
>
>        git ls-tree -r --name-only <commit> <path> | xargs <whatever>
>
> René
Previous: Jeff KingNext: Michael Witten
Message 9 of 15 in “File Systems and a Theory of Edits”
  1. Michael NahasJul 30, 2011
  2. Ævar Arnfjörð BjarmasonJul 30, 2011
  3. René ScharfeJul 31, 2011
  4. Junio C HamanoAug 1, 2011
  5. Michael NahasAug 1, 2011
  6. John M. DlugoszJul 30, 2011
  7. Michael WittenJul 31, 2011
  8. Jeff KingAug 1, 2011
  9. Michael NahasJul 31, 2011
  10. Michael WittenJul 31, 2011
  11. Michael NahasJul 31, 2011
  12. Andreas SchwabJul 31, 2011
  13. Michael NahasJul 31, 2011
  14. Michael NahasAug 1, 2011
  15. René ScharfeJul 31, 2011

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.