From: Junio C Hamano <gitster@pobox.com>
To: Solomon Ucko <solly.ucko@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: reset --merge documentation typo?
Date: Sat, 20 Jun 2020 09:59:37 -0700 [thread overview]
Message-ID: <xmqqo8pdekqu.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CANtMP6qbX_U_0sWtUvNQVtMboMLJshsHc=n-5eA4_XXNGEnzLQ@mail.gmail.com> (Solomon Ucko's message of "Sat, 20 Jun 2020 12:15:54 -0400")
Solomon Ucko <solly.ucko@gmail.com> writes:
> Oops, accidentally sent as HTML instead of plain text.
>
> The documentation for `git reset --merge` states:
It is talknig about `git reset --merge <commit>`.
>> Resets the index and updates the files in the working tree that are
>> different between `<commit>` and `HEAD`, but keeps those which are
>> different between the index and working tree (i.e. which have changes
>> which have not been added).
Correct. The command makes this request to "git".
I am on the commit at `HEAD`; I want to move to <commit> as if I
did "git checkout <otherbranch>", updating the files in the
working tree to that of <otherbranch> except that if I had local
changes from `HEAD` for a path, and the path is identical
between `HEAD` and <otherbranch>, carry my local changes along,
but I am not flipping to a different branch---instead I am
resetting the tip of the current branch.
It allows the user to pretend as if the user started making these
local changes _after_ "git reset --hard <commit>", on top of
<commit>, and that is only possible because the command makes sure
that the paths involved in these local changes are the same between
`HEAD` and <commit>.
> Where it says "`HEAD`", should it say "the index"?
No.
next prev parent reply other threads:[~2020-06-20 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 16:15 reset --merge documentation typo? Solomon Ucko
2020-06-20 16:59 ` Junio C Hamano [this message]
2020-06-20 20:30 ` Solomon Ucko
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=xmqqo8pdekqu.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=solly.ucko@gmail.com \
/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