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

Re: rev-list --sparse?

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 30, 2005, 21:42 UTC
Message-ID
<Pine.LNX.4.64.0510301337500.27915@g5.osdl.org>
In-Reply-To
<7v64rfxuwl.fsf_-_@assigned-by-dhcp.cox.net>
On Sun, 30 Oct 2005, Junio C Hamano wrote:
> 
> The --sparse flag does not seem to have much use either; not
> giving pathspec has the same effect.
No.
--sparse _does_ have effect, but it's subtler.

Try "--sparse" together with a pathspec. It will only do the merge follow optimization.

Now, how useful is that? It's potentially useful as a way to "linearize the history". For example, let's say that you wanted to simplify the commit history for a project, and you only cared about the history of certain files - but you do want all the other files to _exist_ in that history.

So then you could do "git-rev-list --sparse HEAD -- filelist" and you'd get the minimal history that is still relevant in those files. Any merges that touch anything else than those files will becomes just regular diffs: they'll have been linearized away.

Useful? Quite possibly not. But I felt that simplifying merges was conceptually a very different operation from then compressing a linear history.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 26 in “GIT 0.99.9”
  1. Junio C HamanoOct 30, 2005
  2. A Large Angry SCMOct 30, 2005
  3. Junio C HamanoOct 30, 2005
  4. A Large Angry SCMOct 30, 2005
  5. Johannes SchindelinOct 30, 2005
  6. Linus TorvaldsOct 30, 2005
  7. rev-list --sparse?Junio C Hamano, Oct 30, 2005
  8. Linus TorvaldsOct 30, 2005
  9. Junio C HamanoOct 30, 2005
  10. Wolfgang DenkOct 30, 2005
  11. Junio C HamanoOct 30, 2005
  12. Wolfgang DenkOct 30, 2005
  13. Junio C HamanoOct 30, 2005
  14. Wolfgang DenkOct 30, 2005
  15. Ryan AndersonOct 30, 2005
  16. Junio C HamanoOct 30, 2005
  17. H. Peter AnvinOct 30, 2005
  18. Linus TorvaldsOct 31, 2005
  19. Junio C HamanoOct 31, 2005
  20. Linus TorvaldsOct 31, 2005
  21. Date-based limits (Was Re: GIT 0.99.9)Daniel Barkalow, Oct 31, 2005
  22. Junio C HamanoNov 1, 2005
  23. Daniel BarkalowNov 1, 2005
  24. rev-list: make --max- and --min-age a bit more usable.Junio C Hamano, Nov 2, 2005
  25. Linus TorvaldsNov 3, 2005
  26. Junio C HamanoNov 3, 2005

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.