threads / patch / 16077

patchdiff: support making output friendlier for fine, grand users

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

## tl;dr

8 messages between Oct 29, 2008 and Oct 29, 2008. Diffs are folded; open one to read it.

replies: 7people: 6as markdown or json

Petr Baudis· Oct 29, 2008, 05:23 UTC · lore
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(-)
Show changes to diff.c +3 −0
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· Oct 29, 2008, 15:07 UTC · re: Petr Baudis · lore

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

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· Oct 29, 2008, 15:28 UTC · re: David Brown · lore

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

Hi,
On Wed, 29 Oct 2008, David Brown wrote:
Show 7 quoted lines
> 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· Oct 29, 2008, 17:06 UTC · re: Petr Baudis · lore

[PATCH] increase git el1T3nEss

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(-)
Show changes to git.c +26 −1
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· Oct 29, 2008, 17:11 UTC · re: Jeff King · lore

Re: [PATCH] increase git el1T3nEss

On Wed, Oct 29, 2008 at 01:06:31PM -0400, Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
> 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· Oct 29, 2008, 20:28 UTC · re: Jeff King · lore

Re: [PATCH] increase git el1T3nEss

On Wed, 29 Oct 2008, Jeff King wrote:
Show 28 quoted lines
> 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· Oct 29, 2008, 21:50 UTC · re: Daniel Barkalow · lore

Re: [PATCH] increase git el1T3nEss

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· Oct 29, 2008, 22:24 UTC · re: Petr Baudis · lore

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

On Tue, Oct 28, 2008 at 10:23:52PM -0700, Petr Baudis wrote:
Show 10 quoted lines
> 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>

← back to recent threads