Re: [PATCH v2 2/3] stash: remove unnecessary process forking
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 1, 2020, 23:02 UTC
- Message-ID
- <xmqqr1o9m8on.fsf@gitster.c.googlers.com>
- In-Reply-To
- <1fa263cf3c3d1b0c20ad89e6454a7b903a07f193.1606861519.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> git diff-index --cached --name-only --diff-filter=A $CTREE >"$a" > git read-tree --reset $CTREE > git update-index --add --stdin <"$a" > rm -f "$a"
This is orthogonal to what this patch does, as this is supposed to be just bug-for-bug compatible rewrite.
But I wonder if the above sequence, whether it is done as a series of plumbing invocations or subroutine calls, is a relic dating back in the days before i-t-a existed. If we want to revert the changes to the index for working tree files for removed or modified ones, I do not offhand see a good reason why we would want to keep the contents to new paths---if i-t-a were available when the sequence was designed, I suspect we would just have added the path as i-t-a in order to keep track of the presence of the path but not necessarily the contents in it.