git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Add comment lines to patch format
Date: Fri, 18 May 2012 20:14:10 -0400	[thread overview]
Message-ID: <20120519001410.GC765@sigill.intra.peff.net> (raw)
In-Reply-To: <20120518132228.GA27970@do>

On Fri, May 18, 2012 at 08:22:28PM +0700, Nguyen Thai Ngoc Duy wrote:

> One thing is trailing space, like demonstrated in the patch below,
> because trailing spaces may be intentional sometimes. But I'd like to
> incorporate some word-diff goodness in patch format using this comment
> line to spot few/single character addition/removal.
> [...]
> If anyone knows a tool with similar feature, I'd greatly appreciate it
> (as the Internet taught me, everything I think of is already thought
> of/implemented by someone)

Have you looked at contrib/diff-highlight?

I think your approach is interesting because it can annotate much more
than just "this part is interesting". Sometimes when I send a patch, I'd
like to be able to comment in-line, like:

  +       if (bar > 3)
  +               foo(bar);
  = Yeah, this magic "3" is ugly, and we should handle it
  = through $whatever in the re-roll.
  +       else
  +               something_else();

I usually just write something in the cover letter, or reply to myself
with comments inline. I don't know how much I would use it in practice,
but it might be a neat thing for "git apply" to simply ignore comment
lines in the middle of a hunk.

Of course, this feature might not be worth breaking compatibility with
every existing version of "git apply" and "patch" out there.

-Peff

  parent reply	other threads:[~2012-05-19  0:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 13:22 Add comment lines to patch format Nguyen Thai Ngoc Duy
2012-05-18 15:30 ` Junio C Hamano
2012-05-19  4:50   ` Nguyen Thai Ngoc Duy
2012-05-19  0:14 ` Jeff King [this message]
2012-05-19  4:54   ` Nguyen Thai Ngoc Duy

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=20120519001410.GC765@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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).