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

--batch or some --paths-file for very long lists of paths

From
Yaroslav Halchenko <yoh@onerussian.com>
Date
Aug 4, 2022, 22:59 UTC
Message-ID
<YuxPNFtTBmkZkiCW@lena.dartmouth.edu>
Dear Git Gurus,

In DataLad (https://datalad.org) we are doing "our own" analysis of what specific files (not entire directories) should git and git-annex operate on. Obviously, in large repositories (and we have with >100k files) that might require invoking git add or git diff etc with a long list of paths specified in the command line. For that we often split invocation into multiple and even resort to git commit --amend to combine multiple commits then into a single one.

But I wondered if may be there is already some trick to make such commands as status, diff, add, commit to operate on arbitrarily long list of paths passed to that git command somehow.

Note that gitglossary (at least in 2.35.1 git on debian) says that 
	Pathspecs are used on the command line of "git ls-files", "git
    ls-tree", "git add", "git grep", "git diff", "git checkout", and many other
    commands ...
but 
	$> git ls-tree -h | head -n1
	usage: git ls-tree [<options>] <tree-ish> [<path>...]
so it is <path> not the <pathspec> like (why in stderr this time?)
	$> git commit -h 2>&1 | head -n1
	usage: git commit [<options>] [--] <pathspec>...

So if in both cases it is pathspec, may be pathspec could support some other magical keyword like :(filelist)/tmp/mylonglistofpaths ?

Thanks in advance for your time and thoughts,
-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
WWW:   http://www.linkedin.com/in/yarik        
Next: Phillip Wood
Message 1 of 2 in “--batch or some --paths-file for very long lists of paths”
  1. Yaroslav HalchenkoAug 4, 2022
  2. Phillip WoodAug 8, 2022

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.