Re: [Bug] git add -i fails in multiple ways prior to first commit.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [Bug] git add -i fails in multiple ways prior to first commit.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:13

Jeff King [off-list ref] writes:
However, I wonder if this is the best approach. It would be nice if
there were a shorthand for "the empty tree" for diffing, so you could
just diff against that rather than HEAD, and have the regular plumbing
generate.
I guess you can set your worktree to an empty directory and run
diff-files backwards, like perhaps:

	mkdir /var/tmp/empty
        (cd .git && GIT_WORK_TREE=/var/tmp/empty git diff -R)

Have I tried it?  No --- I am not sick enough to be motivated.

Re: [Bug] git add -i fails in multiple ways prior to first commit.

From: Jeff King <hidden>
Date: 2016-06-15 22:44:13

On Wed, Feb 13, 2008 at 03:30:44AM -0800, Junio C Hamano wrote:
quoted
However, I wonder if this is the best approach. It would be nice if
there were a shorthand for "the empty tree" for diffing, so you could
just diff against that rather than HEAD, and have the regular plumbing
generate.
I guess you can set your worktree to an empty directory and run
diff-files backwards, like perhaps:

	mkdir /var/tmp/empty
        (cd .git && GIT_WORK_TREE=/var/tmp/empty git diff -R)

Have I tried it?  No --- I am not sick enough to be motivated.
Actually, I thought of that already. It does work, though when I tried
it, I failed to 'cd .git' which broke it. But yes, I think it is a
nastier solution than just using the "virtual" empty tree.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help