From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 5/6] status: do not depend on flaky reflog messages
Date: Fri, 14 Jun 2013 09:31:47 -0700 [thread overview]
Message-ID: <7vsj0kpsb0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CALkWK0n_Jsb46qPojbGL3S+mPunNQWUOmypQOvdaBjcT5wgJBg@mail.gmail.com> (Ramkumar Ramachandra's message of "Fri, 14 Jun 2013 20:38:10 +0530")
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> Junio C Hamano wrote:
>> As I said (twice), you can argue that that particular piece of
>> information is not useful (at least to you), but why it is not
>> useful has to be justified, against the justification given by
>> b397ea4863a1 (status: show more info than "currently not on any
>> branch", 2013-03-13) and people who have been using that information
>> in the status output, no?
>
> Yes, Junio. I cannot justify that "detached HEAD from" is completely
> useless, because it is not. I argued for a practical compromise, and
> have tried to show the huge negative impact against the marginal gain.
First of all, during a stopped "git rebase", I think "git status"
that says "# HEAD detached at" or "# HEAD detached from" is not
something we want in the end result anyway. In either case, that
comes from the internal use of "git checkout" by the command to
switch out of a concrete branch, which is *not* user initiated.
If you first update "git checkout" so that it will pay attention to
a custom reflog-action exported by Porcelain scripts that may want
to internally use it to flip branches (and without a custom one, it
will still record "checkout: moving from A to B"), without exporting
custom reflog-action from "rebase" and other Porcelain scripts, that
would not affect any externally visible behaviour.
When you teach "git rebase" to pass custom reflog-action when it
detaches the HEAD at "$onto^0" (because that is not a user-initiated
action) as the next step, nth_prior_checkout and 1st_switch would
stop counting them as "checkout" events. That fix will give you the
desired result of the topic of this series, i.e. "git checkout @{-1}"
ignores the internal "git checkout" done by "rebase".
That step may change the output from "git status" but I do not think
the output from "git status" in this sequence:
git rebase ;# stops upon conflict
git status
is anything sacred. Tests modified by b397ea4863a1 (status: show
more info than "currently not on any branch", 2013-03-13) do change
the original "# Not currently on any branch" to "detached at", but I
do not think b397ea4863a1 _wanted_ to say where the $onto commit was
during the rebase (or was it?), so if they have to change to
"detached from", I do not think it is a problem at all. I think it
is very sane to update these selected "detached at" to "detached
from" as needed.
That would be a sensible compromise, because we do not want to see
either "detached at" or "detached from" during "rebase" in the
longer term. We would rather want to see the message start with
something like
# Rebasing X on top of Y (23 commits remaining to be replayed)
which is under discussion in a separate thread lately. The change
to expected output (i.e. "detached at" to "detached from") will have
to be changed again in that separate topic.
The very last test that the b397ea4863a1 added, which wants to see
"detached at atag", should be kept, and also there should be another
test added to reset one step back to make sure we see "detached
from" after it. It tests what the user sees after a "git checkout"
initiated by the end-user.
next prev parent reply other threads:[~2013-06-14 16:32 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 13:32 [PATCH 0/6] Fix git checkout - with rebase Ramkumar Ramachandra
2013-06-13 13:32 ` [PATCH 1/6] t/checkout-last: checkout - doesn't work after rebase Ramkumar Ramachandra
2013-06-13 17:46 ` Junio C Hamano
2013-06-13 18:30 ` Ramkumar Ramachandra
2013-06-13 20:38 ` Junio C Hamano
2013-06-13 13:32 ` [PATCH 2/6] rebase: prepare to write reflog message for checkout Ramkumar Ramachandra
2013-06-13 17:51 ` Junio C Hamano
2013-06-13 18:05 ` Ramkumar Ramachandra
2013-06-13 13:32 ` [PATCH 3/6] rebase -i: " Ramkumar Ramachandra
2013-06-13 17:52 ` Junio C Hamano
2013-06-13 13:32 ` [PATCH 4/6] wt-status: remove unused field in grab_1st_switch_cbdata Ramkumar Ramachandra
2013-06-13 17:54 ` Junio C Hamano
2013-06-13 13:32 ` [PATCH 5/6] status: do not depend on flaky reflog messages Ramkumar Ramachandra
2013-06-13 18:07 ` Junio C Hamano
2013-06-13 18:15 ` Ramkumar Ramachandra
2013-06-13 18:48 ` Ramkumar Ramachandra
2013-06-13 21:02 ` Junio C Hamano
2013-06-14 6:27 ` Ramkumar Ramachandra
2013-06-14 13:52 ` Junio C Hamano
2013-06-14 14:01 ` Ramkumar Ramachandra
2013-06-14 14:52 ` Junio C Hamano
2013-06-14 15:08 ` Ramkumar Ramachandra
2013-06-14 16:31 ` Junio C Hamano [this message]
2013-06-14 21:36 ` Ramkumar Ramachandra
2013-06-14 22:16 ` Junio C Hamano
2013-06-14 22:36 ` Junio C Hamano
2013-06-14 23:07 ` Junio C Hamano
2013-06-15 8:02 ` Ramkumar Ramachandra
2013-06-15 9:58 ` Junio C Hamano
2013-06-15 12:13 ` Ramkumar Ramachandra
2013-06-15 8:44 ` Ramkumar Ramachandra
2013-06-15 9:51 ` Junio C Hamano
2013-06-15 12:08 ` Ramkumar Ramachandra
2013-06-16 5:57 ` Junio C Hamano
2013-06-16 6:07 ` Ramkumar Ramachandra
2013-06-15 10:26 ` Junio C Hamano
2013-06-13 13:32 ` [PATCH 6/6] checkout: respect GIT_REFLOG_ACTION Ramkumar Ramachandra
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=7vsj0kpsb0.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).