Open mlcui-corp opened 1 month ago
This was a fun reminder of a patch I sent to the Git mailing list a long time ago to make git reset --mixed
not refresh the index. That was rejected because although porcelain commands should refresh the index themselves, scripts might expect the index to already be refreshed after running (the porcelain command) git reset
. So I think we should do that too.
Can you check if #3787 helps?
Unfortunately it does not :/
$ jj new push-qlxtorvultuy@origin
$ git ls-files --debug | grep "ctime: 0"
ctime: 0:0
Unfortunately it does not :/
Not surprising. As Yuya commented on the PR the method I found was not the method I was looking for :(
Description
When updating
HEAD@git
, such as byjj new
ing a change that has a different tree than@-
, the changed entries in the Git index get set to all-zeroes.This affects shell prompts which use romkatv/gitstatus, such as romkatv/powerlevel10k.
I have confirmed this also occurred before a075a5c6cabd493759fc973d99d3fd88feb74735.
Steps to Reproduce the Problem
jj new
to another change, which changes files.Example
``` ~/git/jj @3090adfd ❯ jj log -r "main::wz | @" @ lpom mlcui@google.com 2024-05-30 10:29:18 75ad │ (empty) (no description set) │ ○ wzzo mlcui@google.com 2024-05-30 10:02:28 10da ├─╯ test index update ◆ sqww martinvonz@google.com 2024-05-29 23:54:30 main* HEAD@git 3090 │ repo: consider empty and undescribed merge commits as discardable ~ ~/git/jj @3090adfd ❯ jj show -s wz Commit ID: 10da93209b109ca8789a5e5af511a6fad635ec10 Change ID: wzzoqkqrstsxxxztxupwyquwntktqsuo Author: mlcuiExpected Behavior
Running
git update-index --refresh
orgit status
after ajj new
does not update the index.Actual Behavior
Running
git update-index --refresh
orgit status
after ajj new
updates the index as some entries are all-zero.Specifications
main
as of writing) and b31f75bc94c4552454ab929b54b9f37340231fac (before a075a5c6cabd493759fc973d99d3fd88feb74735 was committed)