git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] Teach mailinfo %< as an alternative scissors mark
Date: Sat, 3 Apr 2010 14:52:17 -0500	[thread overview]
Message-ID: <20100403195217.GA26698@progeny.tock> (raw)
In-Reply-To: <7vr5mw8k66.fsf@alter.siamese.dyndns.org>

Handle perforations found “in the wild” more robustly by recognizing
“%<” as an alternative scissors mark.

This feature is only meant to support old habits.  Discourage new use
of the percent-based version by only documenting the 8< symbol so new
users’ perforations can still be recognized by old versions of Git.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Junio C Hamano wrote:

> Thanks, will queue.  By the way, please spell scissors as 8< or >8 not
> with a per-cent at least for now.

Thanks for pointing it out.  I will from now on.

Searching for “cut here” on groups.google.com revealed several examples
like this one:

 ______________________%<__cut here ______________>%_____________

[ed: dashes converted to underscores to avoid confusing am]

So I guess I’m the only one using the small-fingered scissors.  Maybe
this patch could help support old habits.

 builtin/mailinfo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index ce2ef6b..4a9729b 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -746,7 +746,8 @@ static int is_scissors_line(const struct strbuf *line)
 			continue;
 		}
 		if (i + 1 < len &&
-		    (!memcmp(buf + i, ">8", 2) || !memcmp(buf + i, "8<", 2))) {
+		    (!memcmp(buf + i, ">8", 2) || !memcmp(buf + i, "8<", 2) ||
+		     !memcmp(buf + i, ">%", 2) || !memcmp(buf + i, "%<", 2))) {
 			in_perforation = 1;
 			perforation += 2;
 			scissors += 2;
-- 
1.7.0.3

  reply	other threads:[~2010-04-03 19:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01 22:43 [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
2010-04-02  6:47 ` Junio C Hamano
2010-04-02 14:03   ` Eric Blake
2010-04-03  7:47     ` Jonathan Nieder
2010-04-03 18:28       ` Junio C Hamano
2010-04-03 19:52         ` Jonathan Nieder [this message]
2010-04-05 13:14       ` Eric Blake
2010-04-05 14:30         ` Jonathan Nieder
2010-04-05 14:44           ` Eric Blake
2010-04-05 15:11             ` [PATCH] Makefile: avoid a fork in Cygwin version check Jonathan Nieder
2010-04-05 15:36               ` Andreas Schwab

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=20100403195217.GA26698@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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;
as well as URLs for NNTP newsgroup(s).