[PATCH 1/1] diff: support making output friendlier for fine, grand users

Subsystems: the rest

STALE3731d REVIEWED: 1 (0M)

1 review trailer.

8 messages, 6 authors, 2016-06-15 · open the first message on its own page

[PATCH 1/1] diff: support making output friendlier for fine, grand users

From: Petr Baudis <hidden>
Date: 2016-06-15 22:45:32

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Scott Chacon <redacted>
Signed-off-by: Tom Preston-Werner <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: J.H. <redacted>
Signed-off-by: Sam Vilain <redacted>
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Kai Blin <redacted>
Acked-by: Petr Baudis <redacted>
Enabled-by: Cascade "Smooth" Amber [off-list ref]
---
 diff.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index e368fef..0e2c14a 100644
--- a/diff.c
+++ b/diff.c
@@ -2489,6 +2489,9 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 	else if (!prefixcmp(arg, "--output=")) {
 		options->file = fopen(arg + strlen("--output="), "w");
 		options->close_file = 1;
+	}
+	else if (!strcmp(arg, "--pirate")) {
+		printf("Arrrr!  These be yer fine changes, me 'earty!!\n");
 	} else
 		return 0;
 	return 1;
-- 
1.5.4.5

Re: [PATCH 1/1] diff: support making output friendlier for fine, grand users

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:45:32

Hi,

On Wed, 29 Oct 2008, David Brown wrote:
On Tue, Oct 28, 2008 at 10:23:52PM -0700, Petr Baudis wrote:
quoted
+	}
+	else if (!strcmp(arg, "--pirate")) {
+		printf("Arrrr!  These be yer fine changes, me 'earty!!\n");
We need to wait until Sept 19 to apply this patch, however.
We could back-date it, of course.

Ciao,
Dscho

Re: [PATCH 1/1] diff: support making output friendlier for fine, grand users

From: David Brown <hidden>
Date: 2016-06-15 22:45:32

On Tue, Oct 28, 2008 at 10:23:52PM -0700, Petr Baudis wrote:
+	}
+	else if (!strcmp(arg, "--pirate")) {
+		printf("Arrrr!  These be yer fine changes, me 'earty!!\n");
We need to wait until Sept 19 to apply this patch, however.

David

[PATCH] increase git el1T3nEss

From: Jeff King <hidden>
Date: 2016-06-15 22:45:32

The uptake of git by script kiddies has been disappointingly
minimal. Let's make it more palatable by allowing mixed-case
and l33t-speak commands.

Signed-off-by: Jeff King <redacted>
---
This commit was made by "git c0mM1t".

 git.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/git.c b/git.c
index 89feb0b..fd0ca67 100644
--- a/git.c
+++ b/git.c
@@ -261,6 +261,31 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv)
 	return 0;
 }
 
+static char deelite(char in) {
+	if (isalpha(in))
+		return tolower(in);
+	switch (in) {
+	case '0': return 'o';
+	case '1': return 'i';
+	case '3': return 'e';
+	case '5': return 's';
+	case '7': return 'l';
+	}
+	return in;
+}
+
+static int elitecmp(const char *a, const char *b) {
+	while (1) {
+		char ca = deelite(*a), cb = deelite(*b);
+		if (ca != cb)
+			return ca < cb ? -1 : 1;
+		if (!ca)
+			return 0;
+		a++;
+		b++;
+	}
+}
+
 static void handle_internal_command(int argc, const char **argv)
 {
 	const char *cmd = argv[0];
@@ -381,7 +406,7 @@ static void handle_internal_command(int argc, const char **argv)
 
 	for (i = 0; i < ARRAY_SIZE(commands); i++) {
 		struct cmd_struct *p = commands+i;
-		if (strcmp(p->cmd, cmd))
+		if (elitecmp(p->cmd, cmd))
 			continue;
 		exit(run_command(p, argc, argv));
 	}
-- 
1.6.0.3.764.ge6f2.dirty

Re: [PATCH] increase git el1T3nEss

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:45:32

On Wed, Oct 29, 2008 at 01:06:31PM -0400, Jeff King [off-list ref] wrote:
The uptake of git by script kiddies has been disappointingly
minimal. Let's make it more palatable by allowing mixed-case
and l33t-speak commands.

Signed-off-by: Jeff King <redacted>
---
This commit was made by "git c0mM1t".
Testcase?

(I hope it was not serious, just like my question. ;-)

Re: [PATCH] increase git el1T3nEss

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:45:33

On Wed, 29 Oct 2008, Jeff King wrote:
quoted hunk
The uptake of git by script kiddies has been disappointingly
minimal. Let's make it more palatable by allowing mixed-case
and l33t-speak commands.

Signed-off-by: Jeff King <redacted>
---
This commit was made by "git c0mM1t".

 git.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/git.c b/git.c
index 89feb0b..fd0ca67 100644
--- a/git.c
+++ b/git.c
@@ -261,6 +261,31 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv)
 	return 0;
 }
 
+static char deelite(char in) {
+	if (isalpha(in))
+		return tolower(in);
+	switch (in) {
+	case '0': return 'o';
+	case '1': return 'i';
+	case '3': return 'e';
+	case '5': return 's';
+	case '7': return 'l';
Your mapping doesn't comply with ISO 1337.5p34k; 1 can be l (in addition 
to i), and 7 is T. Also, you're missing 4.

	-Daniel
*This .sig left intentionally blank*

Re: [PATCH] increase git el1T3nEss

From: Jeff King <hidden>
Date: 2016-06-15 22:45:33

On Wed, Oct 29, 2008 at 04:28:16PM -0400, Daniel Barkalow wrote:
Your mapping doesn't comply with ISO 1337.5p34k; 1 can be l (in addition 
to i), and 7 is T. Also, you're missing 4.
Patches welcome.

-Peff

Re: [PATCH 1/1] diff: support making output friendlier for fine, grand users

From: Petr Baudis <hidden>
Date: 2016-06-15 22:45:33

On Tue, Oct 28, 2008 at 10:23:52PM -0700, Petr Baudis wrote:
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Scott Chacon <redacted>
Signed-off-by: Tom Preston-Werner <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: J.H. <redacted>
Signed-off-by: Sam Vilain <redacted>
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Kai Blin <redacted>
Acked-by: Petr Baudis <redacted>
Enabled-by: Cascade "Smooth" Amber [off-list ref]
Sponsored-by: A Large Angry SCM [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help