From: Junio C Hamano <gitster@pobox.com>
To: Christian Halstrick <christian.halstrick@gmail.com>
Cc: Git <git@vger.kernel.org>, thomas.wolf@paranor.ch
Subject: Re: git-apply working on an index with smudged entries
Date: Sat, 15 Dec 2018 09:40:55 +0900 [thread overview]
Message-ID: <xmqqzht7bp0o.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAENte7hRCk+3E+C4LYOjTzQKdqE1wN1=HX7YkR72H+HD-=mj5g@mail.gmail.com> (Christian Halstrick's message of "Fri, 14 Dec 2018 11:15:47 +0100")
Christian Halstrick <christian.halstrick@gmail.com> writes:
> Question:
> - is this because the index which jgit created is so corrupt that only
> special commands
> like "git status" can repair it?
No.
> - or is "git apply" not trying hard enough to consume a index with
> smudged entries
No.
Lower level "plumbing" commands like "git apply" want to see the
cached stat information in the index refreshed before they are
called, instead of having to refresh the index themselves before
starting to work, for performance reasons. Higher level "Porcelain"
commands like "git status" on the other hand refreshes the index
before they start to work.
What you are seeing is a combination of
* JGit not running its equivalent of "git update-index --refresh"
before finishing and leaving the index file for you to look at.
* "git status" running an equivalent of "git update-index --refresh"
internally.
* "git apply" not running "update-index --refresh" itself and
instead expecting somebody else to have done so in the sequence
of commands that it is a part of.
The latter two is working perfectly as designed.
I do not know what JGit wanted to do to leave the index in that
state, so I cannot judge if that is a reasonable thing to do or JGit
needs tobe fixed.
prev parent reply other threads:[~2018-12-15 0:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 10:15 git-apply working on an index with smudged entries Christian Halstrick
2018-12-15 0:40 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqzht7bp0o.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=christian.halstrick@gmail.com \
--cc=git@vger.kernel.org \
--cc=thomas.wolf@paranor.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox