public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 0/6] Bring "format-patch --notes" closer to a real feature
Date: Thu, 18 Oct 2012 10:04:11 -0700	[thread overview]
Message-ID: <7v391bn244.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8Dxx6JtRXP_HWNBrobNems+4UsaOGSRef08cf8--b5dOw@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Thu, 18 Oct 2012 18:06:10 +0700")

Nguyen Thai Ngoc Duy <pclouds@gmail•com> writes:

> On Thu, Oct 18, 2012 at 12:45 PM, Junio C Hamano <gitster@pobox•com> wrote:
>> This replaces the earlier "wip" with a real thing.
>>
>> We never advertised the "--notes" option to format-patch (or
>> anything related to the pretty format options for that matter)
>> because the behaviour of these options was whatever they happened to
>> do, not what they were designed to do.
>
> Stupid question: does "git am" recreate notes from "format-patch
> --notes" output? If it does not, should it? I think it could be a nice
> way of copying notes from one machine to another, but not enabled by
> default (iow "am --notes").

Thinking about what the "notes" are, I do not think it should, at
least by default; the model is broken at the conceptual level.

The notes are comments on a commit you make after the fact, because
you do not want to (or cannot afford to) amend the commit to include
the comment.  When you are sending it out over e-mailto be applied
with "am", as opposed to asking the other to pull, you are by
definition willing to see the commit replayed with modification.

I think it is sensible for format-patch/am pipeline when asked to
use --notes to add the notes section after "---" as additional
material to help the recipient understand the context of the patch
better, which is done with this series.  If the submitter (or the
recipient) wants to incorporate the description from the notes to
update the proposed log message, it can easily be done by editing
the output of "format-patch --notes" before sending it out (or
before applying it with "am").

That does not mean that the recipient should not use notes for his
own purpose on the resulting commit, by the way.  It would be a
convenient feature to prime the contents of such a new note the
recipient creates on the resulting commit from the comment after
"---" before the diffstat or "diff --git" line.  Note that (no pun
intended) that additional comment does not have to originate from
any notes in the submitter's repository.  If saving the additional
comments the submitter attached from the notes to the patch is
useful, it would equally be useful to save typed-in comments on the
patch that came from the submitter's fingers, not from the notes.

It is something you can do by inspecting $dotest/patch file in your
post-applypatch hook with today's git.  If many people use and find
such a feature desirable, we could add inbuilt support for it, but I
do not think we are there yet.

      parent reply	other threads:[~2012-10-18 17:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  5:45 [PATCH 0/6] Bring "format-patch --notes" closer to a real feature Junio C Hamano
2012-10-18  5:45 ` [PATCH 1/6] pretty: remove reencode_commit_message() Junio C Hamano
2012-10-18  5:45 ` [PATCH 2/6] format_note(): simplify API Junio C Hamano
2012-10-18  5:45 ` [PATCH 3/6] pretty: prepare notes message at a centralized place Junio C Hamano
2012-10-18  7:49   ` Jeff King
2012-10-18  9:17     ` Junio C Hamano
2012-10-18  9:18       ` Jeff King
2012-10-18 10:00     ` [PATCH] strbuf: always return a non-NULL value from strbuf_detach Jeff King
2012-10-18  5:45 ` [PATCH 4/6] pretty_print_commit(): do not append notes message Junio C Hamano
2012-10-18  5:45 ` [PATCH 5/6] format-patch: append --signature after notes Junio C Hamano
2012-10-18  5:45 ` [PATCH 6/6] format-patch --notes: show notes after three-dashes Junio C Hamano
2012-10-18 21:35   ` Philip Oakley
2012-10-18 22:08     ` Junio C Hamano
2012-10-19 20:06       ` Junio C Hamano
2012-10-21 21:33       ` Philip Oakley
2012-10-18 10:02 ` [PATCH 0/6] Bring "format-patch --notes" closer to a real feature Jeff King
2012-10-18 11:06 ` Nguyen Thai Ngoc Duy
2012-10-18 12:24   ` Michael J Gruber
2012-10-18 17:04   ` 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=7v391bn244.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pclouds@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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