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