git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Denton Liu <liu.denton@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Paul Tan <pyokagan@gmail.com>, Jeff King <peff@peff.net>
Subject: Re: [BUG] incorrect line numbers reported in git am
Date: Fri, 04 Oct 2019 07:56:11 +0900	[thread overview]
Message-ID: <xmqqpnjda16c.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CACsJy8CZCdF-jPeYaAxzpnSbtxbRX42ScSJyYFCfmxZ0YBhZGg@mail.gmail.com> (Duy Nguyen's message of "Thu, 3 Oct 2019 13:17:08 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> On Thu, Oct 3, 2019 at 7:52 AM Junio C Hamano <gitster@pobox.com> wrote:
>> > In fact, running `git am --show-current-patch` shows the whole mail, not
>> > only the 'patch' file so users would have no reason to expect the line
>> > numbers to refer to the 'patch' file.
>>
>> Yeah, show-current-patch was a misguided attempt to hide useful
>> information from the users.
>
> Not so much hiding as not having the information to present, at least
> not the easy way, since the mail is split at the beginning of git-am
> and never stored in $GIT_DIR. By the time this command is run, the
> mail is already gone. Someone could of course update git-am to keep a
> copy of the mail and improve this option.

By "hiding", I meant "rob from the users an opportunity to learn
where the useful patch file is stored".  

You seem to be doubly confused in this case, in that (1) you seem to
have mistaken that I was complaining about show-current-patch not
giving the full information contained in the original e-mail, and
(2) you seem to think show-current-patch gives the contents of the
patch witout other e-mail cruft.  Both are incorrect.

The first thing the command does is to feed the input to mailsplit
and store the results in numbered files "%04d", and they are not
removed until truly done.  When you need to inspect the patch that
does not apply, they are still there.  Even emails for those steps
that have been successfully applied before the current one are also
there (the split files are all gone, though, but they no longer
matter as they have been applied fine).

I wouldn't have been so critical if "git am --show-current-patch"
were implemented as "cat $GIT_DIR/rebase-apply/patch", but it
does an equivalent of "cd $GIT_DIR/rebase-apply; cat $(cat next)"
which is much less useful when trying to fix up the patch text that
does not apply.

  reply	other threads:[~2019-10-03 22:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 18:45 [BUG] incorrect line numbers reported in git am Denton Liu
2019-10-02 19:44 ` Junio C Hamano
2019-10-02 20:08   ` Denton Liu
2019-10-02 20:03 ` Junio C Hamano
2019-10-02 20:16   ` Denton Liu
2019-10-03  0:52     ` Junio C Hamano
2019-10-03  6:17       ` Duy Nguyen
2019-10-03 22:56         ` Junio C Hamano [this message]
2019-10-04 21:59 ` [PATCH] apply: tell user location of corrupted patch file Denton Liu
2019-10-05  8:33   ` Junio C Hamano
2019-10-05 22:44     ` Junio C Hamano
2019-10-05 22:51     ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqpnjda16c.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=pyokagan@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).