Thread (1 message) 1 message, 1 author, 2022-08-08

Re: git add -N vs. git stash

From: Junio C Hamano <hidden>
Date: 2022-08-08 17:31:05

Uwe Kleine-König [off-list ref] writes:
I'd say that's not a feature, is it?
I think that is a sign that "add -N" came much later than "stash",
and whoever added the former was not a heavy user of "stash" ;-)

As the state of the "tracked files in the working tree" and "staged
contents in the index" are both stored as tree objects, I think the
necessary fix would involve

 - record the contents of the "intent-to-add" paths to the tree
   object for the working tree.

 - record the fact that the "intent-to-add" paths are "not in the
   index yet" by removing them from the tree object for the index.

on the recording side (i.e. "stash create"), and then teach the
replay side (i.e. "stash apply") to pay attention to such strange
"exists in the tree for the working tree, but missing from the tree
for the index" paths and mark them with the "intent-to-add" bit.

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