[PATCH] Teach mailinfo %< as an alternative scissors mark
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 3, 2010, 19:52 UTC
- Message-ID
- <20100403195217.GA26698@progeny.tock>
- 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