Two potential bugs in aliases that expand to shell commands

2013-04-03 Thread Han
to my .gitconfig: https://github.com/laughinghan/dotfiles/commit/34f5528825b287ff40acfe57808b32931a87261c ) Han -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 0/2] Two small comment fixes.

2017-09-21 Thread Han-Wen Nienhuys
Han-Wen Nienhuys (2): Fix typo in submodule.h Document the string_list structure string-list.h | 6 ++ submodule.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.14.1.821.g8fa685d3b7-goog

[PATCH 2/2] Document the string_list structure

2017-09-21 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- string-list.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/string-list.h b/string-list.h index 29bfb7ae4..08b534166 100644 --- a/string-list.h +++ b/string-list.h @@ -8,6 +8,12 @@ struct string_list_item { typed

[PATCH 1/2] Fix typo in submodule.h

2017-09-21 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- submodule.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodule.h b/submodule.h index 6b52133c8..f0da0277a 100644 --- a/submodule.h +++ b/submodule.h @@ -120,7 +120,7 @@ extern int submodule_move_head(cons

[GSoC][PATCH v4 3/4] submodule: port set_name_rev() from shell to C

2017-09-21 Thread Han-Wen Nienhuys
LGTM with nits commit message: "revision name, and later handles its formating and printing." typo: formatting + if (!capture_command(, , 0) && sb.len) { + strbuf_strip_suffix(, "\n"); + return strbuf_detach(, NULL); + }

[GSoC][PATCH v4 1/4] submodule--helper: introduce get_submodule_displaypath()

2017-09-21 Thread Han-Wen Nienhuys
LGTM with nits. +static char *get_submodule_displaypath(const char *path, const char *prefix) this could do with a comment /* the result should be freed by the caller. */ + } else if (super_prefix) { + int len = strlen(super_prefix); + const char *format =

[GSoC][PATCH v4 4/4] submodule: port submodule subcommand 'status' from shell to C

2017-09-21 Thread Han-Wen Nienhuys
+ const char *const git_submodule_helper_usage[] = { + N_("git submodule status [--quiet] [--cached] [--recursive] []"), + NULL the manpage over here says git submodule [--quiet] status [--cached] [--recursive] [--] [...] ie. multiple path arguments. Should

[PATCH 3/4] Document submodule_to_gitdir

2017-09-25 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- submodule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/submodule.c b/submodule.c index b12600fc7..b66c23f5d 100644 --- a/submodule.c +++ b/submodule.c @@ -1997,6 +1997,9 @@ const char *get_superproject_working_tre

[PATCH 2/4] Clarify return value ownership of real_path and read_gitfile_gently

2017-09-25 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- abspath.c | 3 +++ setup.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/abspath.c b/abspath.c index 708aff8d4..792a2d533 100644 --- a/abspath.c +++ b/abspath.c @@ -202,6 +202,9 @@ char *strbuf_realpath(

[PATCH 4/4] Move documentation of string_list into string-list.h

2017-09-25 Thread Han-Wen Nienhuys
. * Edited some existing comments to follow the new standard. Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- Documentation/technical/api-string-list.txt | 209 string-list.h | 187 + 2 files change

[PATCH 0/4] Assorted comment fixes

2017-09-25 Thread Han-Wen Nienhuys
I followed Peff's advice for string-list.h comments. Han-Wen Nienhuys (4): Fix typo in submodule.h Clarify return value ownership of real_path and read_gitfile_gently Document submodule_to_gitdir Move documentation of string_list into string-list.h Documentation/technical/api-string

[PATCH 1/4] Fix typo in submodule.h

2017-09-25 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- submodule.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodule.h b/submodule.h index 6b52133c8..f0da0277a 100644 --- a/submodule.h +++ b/submodule.h @@ -120,7 +120,7 @@ extern int submodule_move_head(cons

[PATCH 2/3] read_gitfile_gently: clarify return value ownership.

2017-09-26 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.c b/setup.c index 42400fcc5..8c95841d5 100644 --- a/setup.c +++ b/setup.c @@ -541,7 +541,8 @@ void read_gitfile_error_die(int error_code, const char

[PATCH 1/3] real_path: clarify return value ownership

2017-09-26 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- abspath.c | 4 1 file changed, 4 insertions(+) diff --git a/abspath.c b/abspath.c index 708aff8d4..985798532 100644 --- a/abspath.c +++ b/abspath.c @@ -202,6 +202,10 @@ char *strbuf_realpath(struct strbuf *resolved, const char

[PATCH 0/3] Comment fixes

2017-09-26 Thread Han-Wen Nienhuys
follow more commit log conventions; verified it compiled (yay). (should I send patches that are in 'pu' again as well?) Han-Wen Nienhuys (3): real_path: clarify return value ownership read_gitfile_gently: clarify return value ownership. string-list.h: move documentation from Documentation

[PATCH 3/3] string-list.h: move documentation from Documentation/api/ into header

2017-09-26 Thread Han-Wen Nienhuys
to follow the one from the text file. * Edited some existing comments from string-list.h for consistency. Signed-off-by: Han-Wen Nienhuys <han...@google.com> --- Documentation/technical/api-string-list.txt | 209 string-list.h

Re: [PATCH 4/4] Move documentation of string_list into string-list.h

2017-09-26 Thread Han-Wen Nienhuys
On Tue, Sep 26, 2017 at 7:22 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >> >> Thanks. I am not sure if you can safely reorder the contents of the >> header files in general, but I trust that you made sure that this >> does not introduce problems

Re: grep vs git grep performance?

2017-10-26 Thread Han-Wen Nienhuys
On Thu, Oct 26, 2017 at 5:02 PM, Joe Perches wrote: > Comparing a cache warm git grep vs command line grep > shows significant differences in cpu & wall clock. > > Any ideas how to improve this? Is git-grep multithreaded? IIRC, grep -r uses multiple threads. (Do you have a

[PATCH 2/2] Highlight keywords in remote sideband output.

2018-07-30 Thread Han-Wen Nienhuys
The highlighting is done on the client-side. Supported keywords are "error", "warning", "hint" and "success". The colorization is controlled with the config setting "color.remote". Signed-off-by: Han-Wen Nienhuys Change-Id: I090412

[PATCH 1/2] Document git config getter return value.

2018-07-30 Thread Han-Wen Nienhuys
--- config.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index b95bb7649..d39256eb1 100644 --- a/config.h +++ b/config.h @@ -178,11 +178,16 @@ struct config_set { }; extern void git_configset_init(struct config_set *cs); -extern int

[PATCH 1/1] Highlight keywords in remote sideband output.

2018-07-30 Thread Han-Wen Nienhuys
The highlighting is done on the client-side. Supported keywords are "error", "warning", "hint" and "success". The colorization is controlled with the config setting "color.remote". Signed-off-by: Han-Wen Nienhuys --- sideband.c

[PATCH 0/1] Highlight keywords in remote sideband output.

2018-07-30 Thread Han-Wen Nienhuys
Made tests compile and pass (oops). Remove Change-Id footer. Han-Wen Nienhuys (1): Highlight keywords in remote sideband output. sideband.c | 78 + t/t5409-colorize-remote-messages.sh | 34 + 2 files changed, 103 insertions

Re: [PATCH] RFC Highlight keywords in remote sideband output.

2018-07-30 Thread Han-Wen Nienhuys
sense. I was > fooled greatly by "EMIT_sideband", which in reality does NOT emit at > all. That function is badly misnamed. fixed. > The function is more like "color sideband payload"; actual > "emitting" is still done at the places the code originally "

[PATCH 2/2] Highlight keywords in remote sideband output.

2018-07-30 Thread Han-Wen Nienhuys
The highlighting is done on the client-side. Supported keywords are "error", "warning", "hint" and "success". The colorization is controlled with the config setting "color.remote". Signed-off-by: Han-Wen Nienhuys --- sideband.c

[PATCH 1/2] Document git config getter return value.

2018-07-30 Thread Han-Wen Nienhuys
--- config.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index b95bb7649..d39256eb1 100644 --- a/config.h +++ b/config.h @@ -178,11 +178,16 @@ struct config_set { }; extern void git_configset_init(struct config_set *cs); -extern int

[PATCH] RFC Highlight keywords in remote sideband output.

2018-07-26 Thread Han-Wen Nienhuys
Supported keywords are "error", "warning", "hint" and "success". TODO: * make the coloring optional? What variable to use? * doc for the coloring option. * how to test? Signed-off-by: Han-Wen Nienhuys Change-Id: I090412a1288bc2caef091

Re: [PATCH 1/1] Highlight keywords in remote sideband output.

2018-07-31 Thread Han-Wen Nienhuys
On Mon, Jul 30, 2018 at 11:39 PM Junio C Hamano wrote: > > + */ > > +void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) > > I'll make this "static" to this file while queuing. Does that mean the patch is in? -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

[PATCH 1/2] Document git config getter return value.

2018-07-31 Thread Han-Wen Nienhuys
--- config.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index b95bb7649..d39256eb1 100644 --- a/config.h +++ b/config.h @@ -178,10 +178,16 @@ struct config_set { }; extern void git_configset_init(struct config_set *cs); -extern int

[PATCH 2/2] Highlight keywords in remote sideband output.

2018-07-31 Thread Han-Wen Nienhuys
The highlighting is done on the client-side. Supported keywords are "error", "warning", "hint" and "success". The colorization is controlled with the config setting "color.remote". Co-authored-by: Duy Nguyen Signed-off-by: Han-Wen Nienhu

[PATCH 0/2 v3] Highlight keywords in remote sideband output.

2018-07-31 Thread Han-Wen Nienhuys
squash in Duy's patch Han-Wen Nienhuys (2): Document git config getter return value. Highlight keywords in remote sideband output. Documentation/config.txt| 9 +++ config.h| 10 ++- help.c | 1 + help.h

Re: [PATCH 2/2] Highlight keywords in remote sideband output.

2018-08-01 Thread Han-Wen Nienhuys
On Wed, Aug 1, 2018 at 5:41 PM Junio C Hamano wrote: > Hmm, do we actually say things like "Error: blah"? I am not sure if > I like this strncasecmp all that much. this is for the remote end, so what we (git-core) says isn't all that relevant. The reason I put this here is that Gerrit has some

Re: [PATCH 2/2] Highlight keywords in remote sideband output.

2018-08-02 Thread Han-Wen Nienhuys
On Wed, Aug 1, 2018 at 8:17 PM Junio C Hamano wrote: > >> Hmm, do we actually say things like "Error: blah"? I am not sure if > >> I like this strncasecmp all that much. > > > > this is for the remote end, so what we (git-core) says isn't all that > > relevant. > > It is very relevant, I would

Re: [PATCH 2/2] Highlight keywords in remote sideband output.

2018-08-02 Thread Han-Wen Nienhuys
On Tue, Jul 31, 2018 at 10:21 PM Eric Sunshine wrote: > > On Tue, Jul 31, 2018 at 1:37 PM Han-Wen Nienhuys wrote: > > Highlight keywords in remote sideband output. > > Prefix with the module you're touching, don't capitalize, and drop the > period. Perhaps: Done. >

Re: [PATCH 2/2] Highlight keywords in remote sideband output.

2018-08-02 Thread Han-Wen Nienhuys
On Thu, Aug 2, 2018 at 12:24 PM Eric Sunshine wrote: > > On Wed, Aug 1, 2018 at 2:17 PM Junio C Hamano wrote: > > Han-Wen Nienhuys writes: > > > Sorry for being dense, but do you want me to send an updated patch or > > > not based on your and Eric's comments or not

[PATCH 2/2] sideband: highlight keywords in remote sideband output

2018-08-02 Thread Han-Wen Nienhuys
he TERM variable through the git protocol, so it would require changes to both server and client. Helped-by: Duy Nguyen Signed-off-by: Han-Wen Nienhuys --- Documentation/config.txt| 9 +++ help.c | 1 + help.h | 1 + sid

[PATCH 1/2] config: document git config getter return value.

2018-08-02 Thread Han-Wen Nienhuys
--- config.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index b95bb7649..41700f40b 100644 --- a/config.h +++ b/config.h @@ -178,10 +178,16 @@ struct config_set { }; extern void git_configset_init(struct config_set *cs); -extern int

[PATCH 0/2 v4] sideband: highlight keywords in remote sideband output

2018-08-02 Thread Han-Wen Nienhuys
Address Eric Sunshine's comments. Han-Wen Nienhuys (2): config: document git config getter return value. sideband: highlight keywords in remote sideband output Documentation/config.txt| 9 +++ config.h| 10 ++- help.c

[PATCH 2/2] sideband: highlight keywords in remote sideband output

2018-08-02 Thread Han-Wen Nienhuys
he TERM variable through the git protocol, so it would require changes to both server and client. Helped-by: Duy Nguyen Signed-off-by: Han-Wen Nienhuys --- Documentation/config.txt| 9 +++ help.c | 1 + help.h | 1 + sid

[PATCH 1/2] config: document git config getter return value.

2018-08-02 Thread Han-Wen Nienhuys
--- config.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index b95bb7649..41700f40b 100644 --- a/config.h +++ b/config.h @@ -178,10 +178,16 @@ struct config_set { }; extern void git_configset_init(struct config_set *cs); -extern int

[PATCH 0/2 v4] sideband: highlight keywords in remote sideband output

2018-08-02 Thread Han-Wen Nienhuys
Address Eric Sunshine's comments. Han-Wen Nienhuys (2): config: document git config getter return value. sideband: highlight keywords in remote sideband output Documentation/config.txt| 9 +++ config.h| 10 ++- help.c

Re: [PATCH 2/2] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
On Thu, Aug 2, 2018 at 8:22 PM Junio C Hamano wrote: > > > > Helped-by: Duy Nguyen > > Signed-off-by: Han-Wen Nienhuys > > --- > > Documentation/config.txt| 9 +++ > > help.c | 1 + > > help.h

[PATCH v7 0/1] sideband: highlight keywords in remote sideband output

2018-08-07 Thread Han-Wen Nienhuys
Fix nits; remove debug printf. Han-Wen Nienhuys (1): sideband: highlight keywords in remote sideband output Documentation/config.txt| 12 +++ help.c | 1 + help.h | 1 + sideband.c | 125

[PATCH v7 1/1] sideband: highlight keywords in remote sideband output

2018-08-07 Thread Han-Wen Nienhuys
;error", and they will benefit from this change without requiring a server update. By contrast, a server-side solution would likely require plumbing the TERM variable through the git protocol, so it would require changes to both server and client. Helped-by: Duy Nguyen Signed-off-by: Han-We

[PATCH v5 2/2] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
e through the git protocol, so it would require changes to both server and client. Helped-by: Duy Nguyen Signed-off-by: Han-Wen Nienhuys --- Documentation/config.txt| 12 +++ help.c | 1 + help.h | 1 + sideband.c

[PATCH v5 0/2] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
Address Jun's & Jrn's comments. Han-Wen Nienhuys (2): config: document git config getter return value sideband: highlight keywords in remote sideband output Documentation/config.txt| 12 +++ config.h| 7 +- help.c |

[PATCH v5 1/2] config: document git config getter return value

2018-08-06 Thread Han-Wen Nienhuys
Signed-off-by: Han-Wen Nienhuys --- config.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index bb2f506b27..183b31ebf4 100644 --- a/config.h +++ b/config.h @@ -188,9 +188,14 @@ struct config_set { extern void git_configset_init(struct

Re: [PATCH 2/2] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
On Fri, Aug 3, 2018 at 5:52 AM Jonathan Nieder wrote: > > Hi, > > Han-Wen Nienhuys wrote: > > > The colorization is controlled with the config setting "color.remote". > > > > Supported keywords are "error", "warning", "hint&

[PATCH v6 0/1] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
address Jun's comments. Han-Wen Nienhuys (1): sideband: highlight keywords in remote sideband output Documentation/config.txt| 12 +++ help.c | 1 + help.h | 1 + sideband.c | 127

[PATCH v6 1/1] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
;error", and they will benefit from this change without requiring a server update. By contrast, a server-side solution would likely require plumbing the TERM variable through the git protocol, so it would require changes to both server and client. Helped-by: Duy Nguyen Signed-off-by: Han-We

Re: [PATCH v5 2/2] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
On Mon, Aug 6, 2018 at 7:21 PM Junio C Hamano wrote: > > + If set, keywords at the start of the line are highlighted. The > > + keywords are "error", "warning", "hint" and "success", and are > > + matched case-insensitively. Maybe set to `always`, `false` (or > > + `never`) or

Re: [PATCH v5 2/2] sideband: highlight keywords in remote sideband output

2018-08-06 Thread Han-Wen Nienhuys
On Mon, Aug 6, 2018 at 7:21 PM Junio C Hamano wrote: > > Han-Wen Nienhuys writes: > > > The Git push process itself prints lots of non-actionable messages > > (eg. bandwidth statistics, object counters for different phases of the > > process), which obscure

Re: [PATCH v7 0/1] sideband: highlight keywords in remote sideband output

2018-08-08 Thread Han-Wen Nienhuys
On Tue, Aug 7, 2018 at 11:01 PM Junio C Hamano wrote: > > Han-Wen Nienhuys writes: > > > Fix nits; remove debug printf. > > > > Han-Wen Nienhuys (1): > > sideband: highlight keywords in remote sideband output > > > > Documentatio

Re: [PATCH v5 1/2] config: document git config getter return value

2018-08-06 Thread Han-Wen Nienhuys
On Mon, Aug 6, 2018 at 6:32 PM Junio C Hamano wrote: > patch and queue it on its own merit (not that I think the other one > is not yet good enough---I haven't even looked at it yet ;-). I discovered that emacs tabify will happily also add tabs in the middle of the line, which breaks in the case

Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output

2018-08-20 Thread Han-Wen Nienhuys
On Sat, Aug 18, 2018 at 6:16 PM Junio C Hamano wrote: > > Actually, let's just lose the conditional. strbuf_add() would catch > > and issue an error message when it notices that we fed negative > > count anyway ;-). > > So I'll have this applied on top of the original topic to prevent a > buggy

Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output

2018-08-20 Thread Han-Wen Nienhuys
and, thanks for cleaning up after me :) -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado