git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: Junio C HamanoNext: Eric Blake
Message 6 of 11 in “Makefile: update defaults for modern Cygwin”
  1. Makefile: update defaults for modern CygwinEric Blake, Apr 1, 2010
  2. Junio C HamanoApr 2, 2010
  3. Eric BlakeApr 2, 2010
  4. Jonathan NiederApr 3, 2010
  5. Junio C HamanoApr 3, 2010
  6. Teach mailinfo %< as an alternative scissors markJonathan Nieder, Apr 3, 2010
  7. Eric BlakeApr 5, 2010
  8. Jonathan NiederApr 5, 2010
  9. Eric BlakeApr 5, 2010
  10. Makefile: avoid a fork in Cygwin version checkJonathan Nieder, Apr 5, 2010
  11. Andreas SchwabApr 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.