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

8 messages from 2008-10-29 to 2008-10-29. Participants: Petr Baudis, Johannes Schindelin, David Brown, Jeff King, Miklos Vajna, Daniel Barkalow.
Thread: https://gitlist.dev/t/16077

## Petr Baudis, 2008-10-29 05:23

Subject: [PATCH 1/1] diff: support making output friendlier for fine, grand users
Message-ID: <1225257832-29086-1-git-send-email-pasky@suse.cz>
URL: https://gitlist.dev/e/1225257832-29086-1-git-send-email-pasky%40suse.cz

```
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Scott Chacon <schacon@gmail.com>
Signed-off-by: Tom Preston-Werner <tom@github.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: J.H. <warthog19@eaglescrag.net>
Signed-off-by: Sam Vilain <sam@vilain.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Kai Blin <kai@samba.org>
Acked-by: Petr Baudis <pasky@suse.cz>
Enabled-by: Cascade "Smooth" Amber <clarity@tiedhouse.com>
---
 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

```

## David Brown, 2008-10-29 15:07

Subject: Re: [PATCH 1/1] diff: support making output friendlier for fine, grand users
Message-ID: <20081029150731.GA9942@linode.davidb.org>
URL: https://gitlist.dev/e/20081029150731.GA9942%40linode.davidb.org
In-Reply-To: <1225257832-29086-1-git-send-email-pasky@suse.cz>

```
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

```

## Johannes Schindelin, 2008-10-29 15:28

Subject: Re: [PATCH 1/1] diff: support making output friendlier for fine, grand users
Message-ID: <alpine.DEB.1.00.0810291628050.22125@pacific.mpi-cbg.de.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0810291628050.22125%40pacific.mpi-cbg.de.mpi-cbg.de
In-Reply-To: <20081029150731.GA9942@linode.davidb.org>

```
Hi,

On Wed, 29 Oct 2008, David Brown wrote:

> 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.

We could back-date it, of course.

Ciao,
Dscho

```

## Jeff King, 2008-10-29 17:06

Subject: [PATCH] increase git el1T3nEss
Message-ID: <20081029170631.GA12078@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20081029170631.GA12078%40sigill.intra.peff.net
In-Reply-To: <1225257832-29086-1-git-send-email-pasky@suse.cz>

```
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 <peff@peff.net>
---
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

```

## Miklos Vajna, 2008-10-29 17:11

Subject: Re: [PATCH] increase git el1T3nEss
Message-ID: <20081029171133.GJ24201@genesis.frugalware.org>
URL: https://gitlist.dev/e/20081029171133.GJ24201%40genesis.frugalware.org
In-Reply-To: <20081029170631.GA12078@sigill.intra.peff.net>

```
On Wed, Oct 29, 2008 at 01:06:31PM -0400, Jeff King <peff@peff.net> 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 <peff@peff.net>
> ---
> This commit was made by "git c0mM1t".

Testcase?

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

```

## Daniel Barkalow, 2008-10-29 20:28

Subject: Re: [PATCH] increase git el1T3nEss
Message-ID: <alpine.LNX.1.00.0810291623360.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0810291623360.19665%40iabervon.org
In-Reply-To: <20081029170631.GA12078@sigill.intra.peff.net>

```
On Wed, 29 Oct 2008, Jeff King 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 <peff@peff.net>
> ---
> 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*

```

## Jeff King, 2008-10-29 21:50

Subject: Re: [PATCH] increase git el1T3nEss
Message-ID: <20081029215044.GA19864@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20081029215044.GA19864%40sigill.intra.peff.net
In-Reply-To: <alpine.LNX.1.00.0810291623360.19665@iabervon.org>

```
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

```

## Petr Baudis, 2008-10-29 22:24

Subject: Re: [PATCH 1/1] diff: support making output friendlier for fine, grand users
Message-ID: <20081029222403.GY10544@machine.or.cz>
URL: https://gitlist.dev/e/20081029222403.GY10544%40machine.or.cz
In-Reply-To: <1225257832-29086-1-git-send-email-pasky@suse.cz>

```
On Tue, Oct 28, 2008 at 10:23:52PM -0700, Petr Baudis wrote:
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Scott Chacon <schacon@gmail.com>
> Signed-off-by: Tom Preston-Werner <tom@github.com>
> Signed-off-by: Jeff King <peff@peff.net>
> Signed-off-by: J.H. <warthog19@eaglescrag.net>
> Signed-off-by: Sam Vilain <sam@vilain.net>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> Signed-off-by: Kai Blin <kai@samba.org>
> Acked-by: Petr Baudis <pasky@suse.cz>
> Enabled-by: Cascade "Smooth" Amber <clarity@tiedhouse.com>

Sponsored-by: A Large Angry SCM <gitzilla@gmail.com>

```
