Re: [PATCH v3 0/6] stash: drop usage of a second index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 31, 2020, 17:48 UTC
- Message-ID
- <xmqq4kpn4lu8.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200731165140.29197-1-alban.gruin@gmail.com>
Alban Gruin <alban.gruin@gmail.com> writes:
Show 6 quoted lines
> The old scripted `git stash' used to create a second index to save > modified and untracked files, and restore untracked files, without > affecting the main index. This behaviour was carried on when it was > rewritten in C, and here, most operations performed on the second index > are done by forked commands (ie. `read-tree' instead of reset_tree(), > etc.).
Does the "second index" in the title refer to the on-disk $TMPindex in https://github.com/git/git/blob/ffac537e6c/git-stash.sh#L147 that is used to create a tree object $u_tree (and similarly for the working tree files $w_tree)?
> The goal of this series is to modernise (a bit) builtin/stash.c.
Modernise in what way is quite unclear. With the internal API we have available from C code, we can create a tree object from an in-core index without writing the in-core index out to an on-disk file that is different from the main on-disk index file, and I suspect, from the "drop usage of" in the title, that it is what this series is trying to do, but the description could have been written in a way that is more helpful to readers to understand it without having to guess. It made me wonder if you are not even using the secondary in-core index and no longer writing the tree to record the untracked paths and their contents, but obviously such a patch would not work well ;-)