Re: git send-email (w/o Cc: stable)

2017-06-30 Thread Borislav Petkov
On Thu, Jun 29, 2017 at 03:11:37PM -0700, Luck, Tony wrote: > So there is a "--cc-cmd" option that can do the same as those "-cc" arguments. > Combine that with --suppress-cc=bodycc and things get a bit more automated. Yeah, whatever works for you. I did play with cc-cmd somewhat but can't be bot

Re: Bug with automated processing of git status results

2017-06-30 Thread Konstantin Khomoutov
On Fri, Jun 30, 2017 at 09:00:14AM +0300, Сергей Шестаков wrote: > I am trying to make an automated processing of "git status" results. > I execute the command > > git status -z -uno > > I expect that it has stable output format. However, it still can print > warnings like > > warning: CRLF wil

Re: [PATCH 25/25] diff: document the new --color-moved setting

2017-06-30 Thread Simon Ruderich
On Thu, Jun 29, 2017 at 05:07:10PM -0700, Stefan Beller wrote: > + Small blocks of 3 moved lines or fewer are skipped. If I read the commit messages correctly, this "skipping" process applies to the move detection in general for those smaller blocks and therefore doesn't mean a malicious move

Re: [PATCH] git-p4: parse marshal output "p4 -G" in p4 changes

2017-06-30 Thread Luke Diamand
On 29 June 2017 at 23:41, miguel torroja wrote: > On Thu, Jun 29, 2017 at 8:59 AM, Luke Diamand wrote: >> On 28 June 2017 at 14:14, miguel torroja wrote: >>> Thanks Luke, >>> >>> regarding the error in t9800 (not ok 18 - unresolvable host in P4PORT >>> should display error), for me it's very wei

Re: [PATCH] git-p4: parse marshal output "p4 -G" in p4 changes

2017-06-30 Thread miguel torroja
The Latest patch I sent was already the squashed version with the fix to pass the tests. Thanks, On Fri, Jun 30, 2017 at 9:56 AM, Luke Diamand wrote: > On 29 June 2017 at 23:41, miguel torroja wrote: >> On Thu, Jun 29, 2017 at 8:59 AM, Luke Diamand wrote: >>> On 28 June 2017 at 14:14, miguel t

Re: [PATCH] git-p4: parse marshal output "p4 -G" in p4 changes

2017-06-30 Thread Lars Schneider
> On 30 Jun 2017, at 00:46, miguel torroja wrote: > > The option -G of p4 (python marshal output) gives more context about the > data being output. That's useful when using the command "change -o" as > we can distinguish between warning/error line and real change description. > > Some p4 trigge

Re: Bug with automated processing of git status results

2017-06-30 Thread Matthieu Moy
Сергей Шестаков writes: > I understand that we can turn off core.safecrlf, but it's > inconvinient. Note that you can do that without actually changing the config file: git -c core.safecrlf=false status ... -- Matthieu Moy http://www-verimag.imag.fr/~moy/

Re: Bug with automated processing of git status results

2017-06-30 Thread Torsten Bögershausen
On 30/06/17 11:09, Matthieu Moy wrote: Сергей Шестаков writes: I understand that we can turn off core.safecrlf, but it's inconvinient. Note that you can do that without actually changing the config file: git -c core.safecrlf=false status ... Beside that, I would recommend to set up a

Re: [PATCH] git-p4: parse marshal output "p4 -G" in p4 changes

2017-06-30 Thread Miguel Torroja
On Fri, Jun 30, 2017 at 10:26 AM, Lars Schneider wrote: > >> On 30 Jun 2017, at 00:46, miguel torroja wrote: >> >> The option -G of p4 (python marshal output) gives more context about the >> data being output. That's useful when using the command "change -o" as >> we can distinguish between warni

[PATCH 3/4] Git::unquote_path() throw an exception on bad path

2017-06-30 Thread Phillip Wood
From: Phillip Wood This is what the other routines in Git.pm do if there's an error. Signed-off-by: Phillip Wood --- perl/Git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/Git.pm b/perl/Git.pm index f075b500c510d183074c0358fb24fefc72248125..baf80d1ab038590c85

[PATCH 1/4] add -i move unquote_path() to Git.pm

2017-06-30 Thread Phillip Wood
From: Phillip Wood Move unquote_path() from git-add--interactive to Git.pm so it can be used by other scripts. Note this is a straight copy, it does not handle '\a'. That will be fixed in the next commit. Signed-off-by: Phillip Wood --- git-add--interactive.perl | 43 +-

[PATCH 2/4] Git::unquote_path() Handle '\a'

2017-06-30 Thread Phillip Wood
From: Phillip Wood The version copied from git-add--interactive did not handle quoted paths containing '\a'. Signed-off-by: Phillip Wood --- perl/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index 35188842ef82c67f83f6d72fd37e38edb89532

[PATCH 4/4] Add tests for Git::unquote_path()

2017-06-30 Thread Phillip Wood
From: Phillip Wood Check that unquote_path() handles spaces and escape sequences properly Signed-off-by: Phillip Wood --- t/t9700/test.pl | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/t9700/test.pl b/t/t9700/test.pl index 1b75c919651a8126e2a327f3d9645d4377823726..34cd01366f9216

[PATCH 0/4] Move unquote_path from git-add--interactive.perl to Git.pm

2017-06-30 Thread Phillip Wood
From: Phillip Wood Thanks for the review Junio, I've amended the patches as you suggested. The first patch now removes unquote_path() from add -i as well as adding it to Git.pm. I've fixed the naming issues (the version I sent previously was copied from another script rather than directly from a

Re: [PATCH 0/5] Move unquote_path() from git-add--interactive.perl to Git.pm

2017-06-30 Thread Phillip Wood
On 23/06/17 00:18, Jeff King wrote: > On Thu, Jun 22, 2017 at 11:26:17AM +0100, Phillip Wood wrote: > >> From: Phillip Wood >> >> I'm using this in some scripts and it would be more convenient to have >> it available from Git.pm rather than copying and pasting it each time >> I need it. I think i

Re: [PATCH] git-p4: parse marshal output "p4 -G" in p4 changes

2017-06-30 Thread Lars Schneider
> On 30 Jun 2017, at 11:41, Miguel Torroja wrote: > > On Fri, Jun 30, 2017 at 10:26 AM, Lars Schneider > wrote: >> >>> On 30 Jun 2017, at 00:46, miguel torroja wrote: >>> >>> The option -G of p4 (python marshal output) gives more context about the >>> data being output. That's useful when us

[PATCH 1/2] commit-template: remove outdated notice about explicit paths

2017-06-30 Thread Kaartic Sivaraam
The notice that "git commit " default to "git commit --only " was there since 756e3ee0 ("Merge branch 'jc/commit'", 2006-02-14). Back then, existing users of Git expected the command doing "git commit --include ", and after the behaviour of the command was changed to align with other people's "$sc

[PATCH 2/2] commit-template: distinguish status information unconditionally

2017-06-30 Thread Kaartic Sivaraam
The commit template adds the status information without adding a new line to distinguish them in the absence of optional parts. This results in difficulty in interpreting it's content, specifically for inexperienced users. Unconditionally, add new lines to separate the status message from the othe

speeding up git pull from a busy gerrit instance over a slow link?

2017-06-30 Thread Noel Grandin
Hi I'm running git version 2.13.1 on Ubuntu 16.04 (x64) I'm connecting over a very slow (international link) to a very busy gerrit server (gerrit.libreoffice.org) using ssh. Ping types are on the order of 200ms. Using GIT_TRACE_PACKET=true, what I am seeing is that the bulk of the time is spen

Re: [PATCH 2/2] commit-template: distinguish status information unconditionally

2017-06-30 Thread Junio C Hamano
Thanks, both looks good. Will queue.

Dear Beloved

2017-06-30 Thread Mrs marios
-- Dear Beloved Friend I am Mrs Nicole Benoite Marois and I have been suffering from ovarian cancer disease and the doctor says that i have just few weeks to leave. I am from (Paris) France but based in Benin republic since eleven years ago as a business woman dealing with gold exportation b

Re: [PATCH 0/4] Move unquote_path from git-add--interactive.perl to Git.pm

2017-06-30 Thread Junio C Hamano
Looks good. Will queue. Thanks.

[PATCH] hooks: add signature to the top of the commit message

2017-06-30 Thread Kaartic Sivaraam
The sample hook to prepare the commit message before a commit allows users to opt-in to add the signature to the commit message. The signature is added at a place that isn't consistent with the "-s" option of "git commit". Further, it could go out of view in certain cases. Add the signature to the

Re: [PATCH] git-p4: parse marshal output "p4 -G" in p4 changes

2017-06-30 Thread Miguel Torroja
On Fri, Jun 30, 2017 at 12:13 PM, Lars Schneider wrote: > >> On 30 Jun 2017, at 11:41, Miguel Torroja wrote: >> >> On Fri, Jun 30, 2017 at 10:26 AM, Lars Schneider >> wrote: >>> On 30 Jun 2017, at 00:46, miguel torroja wrote: The option -G of p4 (python marshal output) gives more

Re: [PATCH 25/25] diff: document the new --color-moved setting

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 12:26 AM, Simon Ruderich wrote: > On Thu, Jun 29, 2017 at 05:07:10PM -0700, Stefan Beller wrote: >> + Small blocks of 3 moved lines or fewer are skipped. > > If I read the commit messages correctly, this "skipping" process > applies to the move detection in general for

git log use of date format differs between Command Line and script usage.

2017-06-30 Thread Shaun Uldrikis
If you supply a non-standard format to the date configuration for git log, something like: [log] date = format:%Y-%m-%d %H:%M then, when you run 'git log' inside a script, or when using gitk (anywhere), it fails on decoding the format. fatal: unknown date format format: %Y-%m-%d %H:%M H

[PATCH] status: suppress additional warning output in plumbing modes

2017-06-30 Thread Stefan Beller
When status is called with '--porcelain' (as implied by '-z'), we promise to output only messages as described in the man page. Suppress CRLF warnings. Signed-off-by: Stefan Beller --- Maybe something like this? builtin/commit.c | 5 + 1 file changed, 5 insertions(+) diff --git a/builtin

Re: git log use of date format differs between Command Line and script usage.

2017-06-30 Thread René Scharfe
Am 30.06.2017 um 18:06 schrieb Shaun Uldrikis: If you supply a non-standard format to the date configuration for git log, something like: [log] date = format:%Y-%m-%d %H:%M then, when you run 'git log' inside a script, or when using gitk (anywhere), it fails on decoding the format. fat

Re: git log use of date format differs between Command Line and script usage.

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 9:06 AM, Shaun Uldrikis wrote: > If you supply a non-standard format to the date configuration for git > log, something like: > [log] > date = format:%Y-%m-%d %H:%M So I ran $ git config log.date "format:%Y-%m-%d %H:%M" $ git config --list |grep log.date

Re: [PATCH] hooks: add signature to the top of the commit message

2017-06-30 Thread Junio C Hamano
Kaartic Sivaraam writes: > The sample hook to prepare the commit message before > a commit allows users to opt-in to add the signature > to the commit message. The signature is added at a place > that isn't consistent with the "-s" option of "git commit". > Further, it could go out of view in cer

Re: [PATCH v2 5/6] grep: remove regflags from the public grep_opt API

2017-06-30 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > @@ -169,6 +167,24 @@ void grep_init(struct grep_opt *opt, const char *prefix) > > static void grep_set_pattern_type_option(enum grep_pattern_type > pattern_type, struct grep_opt *opt) > { > + /* > + * When committing to the pattern type by setting

Re: [PATCH 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > Yes it was a last minute squash before sending it out, as the fix was only > two lines whereas the conversion is a lot. If it were separated I could have > claimed the introduction to be a rather mechanical patch, but I did not > make use of coccinelle or such, so the like

Re: git log use of date format differs between Command Line and script usage.

2017-06-30 Thread Shaun Uldrikis
Yes. That is the case. Just confirmed it. I'll remove the old version. Sorry to have bothered the mailing list. Thank you. -Shaun On Fri, Jun 30, 2017 at 12:43 PM, Stefan Beller wrote: > On Fri, Jun 30, 2017 at 9:06 AM, Shaun Uldrikis wrote: >> If you supply a non-standard format to the date c

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > When using the hashmap a common need is to have access to arbitrary data > in the compare function. A couple of times we abuse the keydata field > to pass in the data needed. This happens for example in patch-ids.c. It is not "arbitrary data"; it is very important to stre

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > diff --git a/patch-ids.c b/patch-ids.c > index 9c0ab9e67a..b9b2ebbad0 100644 > --- a/patch-ids.c > +++ b/patch-ids.c > @@ -37,6 +37,7 @@ int commit_patch_id(struct commit *commit, struct > diff_options *options, > */ > static int patch_id_cmp(struct patch_id *a, >

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 10:34 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> When using the hashmap a common need is to have access to arbitrary data >> in the compare function. A couple of times we abuse the keydata field >> to pass in the data needed. This happens for example in patch-i

Re: [PATCH 22/25] diff.c: color moved lines differently

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > +static int next_byte(const char **cp, const char **endp, > + const struct diff_options *diffopt) > +{ > + int retval; > + > + if (DIFF_XDL_TST(diffopt, IGNORE_WHITESPACE_AT_EOL)) { > + while (*endp > *cp && isspace(**endp)) > +

Re: [PATCH] merge-recursive: use DIFF_XDL_SET macro

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > Instead of implementing this on our own, just use a convenience macro. > > Signed-off-by: Stefan Beller > --- Good eyes. Thanks. > merge-recursive.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/merge-recursive.c b/merge-recursive.c >

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 10:39 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> diff --git a/patch-ids.c b/patch-ids.c >> index 9c0ab9e67a..b9b2ebbad0 100644 >> --- a/patch-ids.c >> +++ b/patch-ids.c >> @@ -37,6 +37,7 @@ int commit_patch_id(struct commit *commit, struct >> diff_options *opt

Re: [PATCH 22/25] diff.c: color moved lines differently

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 10:54 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> +static int next_byte(const char **cp, const char **endp, >> + const struct diff_options *diffopt) >> +{ >> + int retval; >> + >> + if (DIFF_XDL_TST(diffopt, IGNORE_WHITESPACE_AT_EOL)) {

Re: [PATCH v8 6/6] convert: add "status=delayed" to filter process protocol

2017-06-30 Thread Junio C Hamano
Lars Schneider writes: >> On 29 Jun 2017, at 20:34, Junio C Hamano wrote: >> >> You seem to have squashed an unrelated "table-driven" clean-up into >> this step. While I think the end result looks good, I would have >> liked to see it as a separate step, either as a preparatory "now we >> are

Re: RFC: Missing blob hook might be invoked infinitely recursively

2017-06-30 Thread Jeff Hostetler
On 6/29/2017 2:48 PM, Jonathan Tan wrote: As some of you may know, I'm currently working on support for partial clones/fetches in Git (where blobs above a user-specified size threshold are not downloaded - only their names and sizes are downloaded). To do this, the client repository needs to be

Re: Warning suggestion for git stash drop

2017-06-30 Thread Laurent Humblet
Thank you for your feedback. I suppose that turning a hypothetical confirmation option 'on' would impact a stash pop for instance as it automatically drops the stash if it was applied without conflicts. What about a --confirm flag? You could then simply alias 'git stash drop --confirm' locally a

MISE À NIVEAU EMAIL

2017-06-30 Thread helpd...@grenoble-inp.fr
-- Cher: Grenoble Institute of Technology Webmail, Nous vous annonons que votre compte de messagerie a dépassé son stockage limite. Vous ne pourrez pas envoyer et recevoir des mails et votre compte de messagerie Seront supprimés de notre serveur. Pour éviter ce problème, il est conseillé de

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > I am at a loss here after re-reading your answer over and over, > but I think you are asking if patch_id_cmp can break, as > we have a callchain like > > patch_id_cmp > commit_patch_id > (diff_root_tree_oid) > diff_tree_oid > ll_diff_tree_oid

Re: [PATCH 22/25] diff.c: color moved lines differently

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Jun 30, 2017 at 10:54 AM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> +static int next_byte(const char **cp, const char **endp, >>> + const struct diff_options *diffopt) >>> +{ >>> + int retval; >>> + >>> + if (DIFF_XDL_TST(diff

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > Ok, let me redo the patch to have fndata at the front. > > Looking at other places (that have a similar mechanism mechanically, > but are semantically different), such as the callback functions for > the diff machinery, we have the user provided pointer at the end > of the

Re: [PATCHv2 1/2] hashmap.h: compare function has access to a data field

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 11:47 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> Ok, let me redo the patch to have fndata at the front. >> >> Looking at other places (that have a similar mechanism mechanically, >> but are semantically different), such as the callback functions for >> the diff

[PATCHv3 1/3] hashmap.h: compare function has access to a data field

2017-06-30 Thread Stefan Beller
When using the hashmap a common need is to have access to caller provided data in the compare function. A couple of times we abuse the keydata field to pass in the data needed. This happens for example in patch-ids.c. This patch changes the function signature of the compare function to have one mo

[PATCHv3 0/3] Introduce data field in hashmap and migrate docs to header

2017-06-30 Thread Stefan Beller
v3: * fixed first patch to call the data 'caller provided' instead of arbitrary. * moved the position of the caller provided data to first position * split up the rather mechanical change of function signature with fixing the API usage of patch-ids.c v2: addressed all but the last point of Jon

[PATCHv3 2/3] patch-ids.c: use hashmap correctly

2017-06-30 Thread Stefan Beller
As eluded to in the previous patch, the code in patch-ids.c is using the hashmaps API wrong. Luckily we do not have a bug, as all hashmap functionality that we use here (hashmap_get) passes through the keydata. If hashmap_get_next were to be used, a bug would occur as that passes NULL for the key

[PATCHv3 3/3] hashmap: migrate documentation from Documentation/technical into header

2017-06-30 Thread Stefan Beller
While at it, clarify the use of `key`, `keydata`, `entry_or_key` as well as documenting the new data pointer for the compare function. Rework the example. Signed-off-by: Stefan Beller --- Documentation/technical/api-hashmap.txt | 309 hashmap.h

Re: Warning suggestion for git stash drop

2017-06-30 Thread Junio C Hamano
Laurent Humblet writes: > Thank you for your feedback. > > I suppose that turning a hypothetical confirmation option 'on' would > impact a stash pop for instance as it automatically drops the stash if > it was applied without conflicts. > > What about a --confirm flag? You could then simply alia

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

2017-06-30 Thread Prathamesh Chavan
This aims to make git-submodule 'status' a built-in. Hence, the function cmd_status() is ported from shell to C. This is done by introducing three functions: module_status(), submodule_status() and print_status(). The function module_status() acts as the front-end of the subcommand. It parses subc

[GSoC][PATCH 2/5 v3] submodule--helper: introduce for_each_submodule_list()

2017-06-30 Thread Prathamesh Chavan
Introduce function for_each_submodule_list() and replace a loop in module_init() with a call to it. The new function will also be used in other parts of the system in later patches. Mentored-by: Christian Couder Mentored-by: Stefan Beller Signed-off-by: Prathamesh Chavan --- builtin/submodule

[GSoC][PATCH 5/5 v3] submodule: port submodule subcommand 'sync' from shell to C

2017-06-30 Thread Prathamesh Chavan
Port the submodule subcommand 'sync' from shell to C using the same mechanism as that used for porting submodule subcommand 'status'. Hence, here the function cmd_sync() is ported from shell to C. This is done by introducing three functions: module_sync(), sync_submodule() and print_default_remote(

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

2017-06-30 Thread Prathamesh Chavan
Function set_name_rev() is ported from git-submodule to the submodule--helper builtin. The function get_name_rev() generates the value of the revision name as required, and the function print_name_rev() handles the formating and printing of the obtained revision name. Mentored-by: Christian Couder

Re: [PATCHv3 2/3] patch-ids.c: use hashmap correctly

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > As eluded to in the previous patch, the code in patch-ids.c is using > the hashmaps API wrong. > > Luckily we do not have a bug, as all hashmap functionality that we use > here (hashmap_get) passes through the keydata. If hashmap_get_next were > to be used, a bug would oc

[GSoC][PATCH 1/5 v3] submodule--helper: introduce get_submodule_displaypath()

2017-06-30 Thread Prathamesh Chavan
Introduce function get_submodule_displaypath() to replace the code occurring in submodule_init() for generating displaypath of the submodule with a call to it. This new function will also be used in other parts of the system in later patches. Mentored-by: Christian Couder Mentored-by: Stefan Bel

Re: [GSoC][PATCH 5/5 v3] submodule: port submodule subcommand 'sync' from shell to C

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 12:47 PM, Prathamesh Chavan wrote: > Port the submodule subcommand 'sync' from shell to C using the same > mechanism as that used for porting submodule subcommand 'status'. > Hence, here the function cmd_sync() is ported from shell to C. > This is done by introducing three

Re: [PATCH 25/25] diff: document the new --color-moved setting

2017-06-30 Thread Simon Ruderich
On Fri, Jun 30, 2017 at 09:04:50AM -0700, Stefan Beller wrote: > [snip] > > However > > context > + moved line, block A or B > + moved line, block A or B > context > > is omitted, because the number of lines > here is fewer than 3 ignoring the block > type. > > Maybe > > If there are

Re: [PATCH 25/25] diff: document the new --color-moved setting

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 1:31 PM, Simon Ruderich wrote: > On Fri, Jun 30, 2017 at 09:04:50AM -0700, Stefan Beller wrote: >> [snip] >> >> However >> >> context >> + moved line, block A or B >> + moved line, block A or B >> context >> >> is omitted, because the number of lines >> here is

[PATCH v9 0/7] convert: add "status=delayed" to filter process protocol

2017-06-30 Thread Lars Schneider
Hi, here is the 9th iteration of my "status delayed" topic. I think that might be the final one :-) Patch 1 to 3 are minor t0021 test adjustments. Patch 4 to 6 are convert refactorings to prepare the new feature. Patch 7 is the new feature. ### Changes since v7: * extracted capabilities negotiat

[PATCH v9 5/7] convert: move multiple file filter error handling to separate function

2017-06-30 Thread Lars Schneider
Refactoring the filter error handling is useful for the subsequent patch 'convert: add "status=delayed" to filter process protocol'. In addition, replace the parentheses around the empty "if" block with a single semicolon to adhere to the Git style guide. Signed-off-by: Lars Schneider --- conve

[PATCH v9 4/7] convert: put the flags field before the flag itself for consistent style

2017-06-30 Thread Lars Schneider
Suggested-by: Jeff King Signed-off-by: Lars Schneider --- convert.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/convert.c b/convert.c index f1e168bc30..9907e3b9ba 100644 --- a/convert.c +++ b/convert.c @@ -597,12 +597,12 @@ static int apply_multi_file_filter(co

[PATCH v9 3/7] t0021: write "OUT " only on success

2017-06-30 Thread Lars Schneider
"rot13-filter.pl" always writes "OUT " to the debug log at the end of a response. This works perfectly for the existing responses "abort", "error", and "success". A new response "delayed", that will be introduced in a subsequent patch, accepts the input without giving the filtered result right awa

[PATCH v9 1/7] t0021: keep filter log files on comparison

2017-06-30 Thread Lars Schneider
The filter log files are modified on comparison. That might be unexpected by the caller. It would be even undesirable if the caller wants to reuse the original log files. Address these issues by using temp files for modifications. This is useful for the subsequent patch 'convert: add "status=delay

[PATCH v9 7/7] convert: add "status=delayed" to filter process protocol

2017-06-30 Thread Lars Schneider
Some `clean` / `smudge` filters may require a significant amount of time to process a single blob (e.g. the Git LFS smudge filter might perform network requests). During this process the Git checkout operation is blocked and Git needs to wait until the filter is done to continue with the checkout.

[PATCH v9 6/7] convert: refactor capabilities negotiation

2017-06-30 Thread Lars Schneider
The code to negotiate long running filter capabilities was very repetitive for new capabilities. Replace the repetitive conditional statements with a table-driven approach. This is useful for the subsequent patch 'convert: add "status=delayed" to filter process protocol'. Suggested-by: Junio C Ham

[PATCH v9 2/7] t0021: make debug log file name configurable

2017-06-30 Thread Lars Schneider
The "rot13-filter.pl" helper wrote its debug logs always to "rot13-filter.log". Make this configurable by defining the log file as first parameter of "rot13-filter.pl". This is useful if "rot13-filter.pl" is configured multiple times similar to the subsequent patch 'convert: add "status=delayed" t

Re: [PATCH v8 6/6] convert: add "status=delayed" to filter process protocol

2017-06-30 Thread Lars Schneider
> On 30 Jun 2017, at 20:19, Junio C Hamano wrote: > > Lars Schneider writes: > >>> On 29 Jun 2017, at 20:34, Junio C Hamano wrote: >>> >>> You seem to have squashed an unrelated "table-driven" clean-up into >>> this step. While I think the end result looks good, I would have >>> liked to se

[PATCHv2 00/25] Reroll of sb/diff-color-moved.

2017-06-30 Thread Stefan Beller
v2: * on top of the new hashmap patches[3]. It compiles when put on older versions of the hashmap series, as the hashmap compare function just swapped void pointers in the definition. * better documentation, Thanks Simon! ... If there are fewer than 3 adjacent moved lines, they are

[PATCHv2 07/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_NO_LF_EOF

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/diff.c b/diff.c index 6e48a129ed..488096b757 100644 --- a/diff.c +++ b/diff.c @@ -561,6 +561,7 @@ static void emit_line(struct diff_optio

[PATCHv2 01/25] diff.c: readability fix

2017-06-30 Thread Stefan Beller
We already have dereferenced 'p->two' into a local variable 'two'. Use that. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index 00b4c86698..2874dfc6fc 100644 --- a/diff.c +++ b/diff.

[PATCHv2 05/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_MARKER

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 4637368d59..75b996c4cf 100644 --- a/diff.c +++ b/diff.c @@ -561,13 +561,20 @@ static void emit_line(struct diff_options *o, co

[PATCHv2 06/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_FRAGINFO

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index 75b996c4cf..6e48a129ed 100644 --- a/diff.c +++ b/diff.c @@ -561,6 +561,7 @@ static void emit_line(struct diff_options *o, const

[PATCHv2 02/25] diff.c: move line ending check into emit_hunk_header

2017-06-30 Thread Stefan Beller
The emit_hunk_header() function is responsible for assembling a hunk header and calling emit_line() to send the hunk header to the output file. Its only caller fn_out_consume() needs to prepare for a case where the function emits an incomplete line and add the terminating LF. Instead make sure em

[PATCHv2 20/25] diff.c: emit_diff_symbol learns about DIFF_SYMBOL_SUMMARY

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 71 ++ 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/diff.c b/diff.c index 5a9c55736d..2db0d7c0f5 100644 --- a/diff.c +++ b/diff.c @@ -572,6 +

[PATCHv2 17/25] diff.c: convert show_stats to use emit_diff_symbol

2017-06-30 Thread Stefan Beller
We call print_stat_summary from builtin/apply, so we still need the version with a file pointer, so introduce print_stat_summary_0 that uses emit_string machinery and keep print_stat_summary with the same arguments around. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c |

[PATCHv2 18/25] diff.c: convert word diffing to use emit_diff_symbol

2017-06-30 Thread Stefan Beller
The word diffing is not line oriented and would need some serious effort to be transformed into a line oriented approach, so just go with a symbol DIFF_SYMBOL_WORD_DIFF that is a partial line. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 79 +++

[PATCHv2 13/25] diff.c: emit_diff_symbol learns about DIFF_SYMBOL_BINARY_FILES

2017-06-30 Thread Stefan Beller
we could save a little bit of memory when buffering in a later mode by just passing the inner part ("%s and %s", file1, file 2), but those a just a few bytes, so instead let's reuse the implementation from DIFF_SYMBOL_HEADER and keep the whole line around. Signed-off-by: Stefan Beller Signed-off-

[PATCHv2 15/25] submodule.c: migrate diff output to use emit_diff_symbol

2017-06-30 Thread Stefan Beller
As the submodule process is no longer attached to the same file pointer 'o->file' as the superprojects process, there is a different result in color.c::check_auto_color. That is why we need to pass coloring explicitly, such that the submodule coloring decision will be made by the child process proc

[PATCHv2 14/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_REWRITE_DIFF

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/diff.c b/diff.c index 1d0f8b509f..5c428e02b6 100644 --- a/diff.c +++ b/diff.c @@ -561,6 +561,7 @@ static void emit_line(

[PATCHv2 12/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_HEADER

2017-06-30 Thread Stefan Beller
The header is constructed lazily including line breaks, so just emit the raw string as is. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 28 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/diff.c b/diff.c index 49b45fef29..78

[PATCHv2 09/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_WORDS[_PORCELAIN]

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 42 ++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/diff.c b/diff.c index e5430d56da..85bfd9310d 100644 --- a/diff.c +++ b/diff.c @@ -561,6 +561,8 @@ static void emi

[PATCHv2 19/25] diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c index e0d39d04da..5a9c55736d 100644 --- a/diff.c +++ b/diff.c @@ -571,6 +571,7 @@ enum diff_symbol { DIFF_SYMBOL_STATS_SUMM

[PATCHv2 24/25] diff.c: add dimming to moved line detection

2017-06-30 Thread Stefan Beller
Any lines inside a moved block of code are not interesting. Boundaries of blocks are only interesting if they are next to another block of moved code. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- color.h| 2 + diff.c | 132

[PATCHv2 25/25] diff: document the new --color-moved setting

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- Documentation/config.txt | 15 +-- Documentation/diff-options.txt | 36 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 06898a7498..743

[PATCHv2 21/25] diff.c: buffer all output if asked to

2017-06-30 Thread Stefan Beller
Introduce a new option 'emitted_symbols' in the struct diff_options which controls whether all output is buffered up until all output is available. It is set internally in diff.c when necessary. We'll have a new struct 'emitted_string' in diff.c which will be used to buffer each line. The emitted

[PATCHv2 22/25] diff.c: color moved lines differently

2017-06-30 Thread Stefan Beller
When a patch consists mostly of moving blocks of code around, it can be quite tedious to ensure that the blocks are moved verbatim, and not undesirably modified in the move. To that end, color blocks that are moved within the same patch differently. For example (OM, del, add, and NM are different c

[PATCHv2 23/25] diff.c: color moved lines differently, plain mode

2017-06-30 Thread Stefan Beller
Add the 'plain' mode for move detection of code. This omits the checking for adjacent blocks, so it is not as useful. If you have a lot of the same blocks moved in the same patch, the 'Zebra' would end up slow as it is O(n^2) (n is number of same blocks). So this may be useful there and is generall

[PATCHv2 11/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_FILEPAIR_{PLUS, MINUS}

2017-06-30 Thread Stefan Beller
We have to use fprintf instead of emit_line, because we want to emit the tab after the color. This is important for ancient versions of gnu patch AFAICT, although we probably do not want to feed colored output to the patch utility, such that it would not matter if the trailing tab is colored. Keep

[PATCHv2 10/25] diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_INCOMPLETE

2017-06-30 Thread Stefan Beller
The context marker use the exact same output pattern, so reuse it. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index 85bfd9310d..b2b2a19fcf 100644 --- a/diff.c +++ b/diff.c @@ -56

[PATCHv2 16/25] diff.c: convert emit_binary_diff_body to use emit_diff_symbol

2017-06-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 63 ++- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/diff.c b/diff.c index 48f719fb07..f5a14359ae 100644 --- a/diff.c +++ b/diff.c @@ -561,6 +561

[PATCHv2 03/25] diff.c: factor out diff_flush_patch_all_file_pairs

2017-06-30 Thread Stefan Beller
In a later patch we want to do more things before and after all filepairs are flushed. So factor flushing out all file pairs into its own function that the new code can be plugged in easily. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff.c | 17 - 1 file cha

[PATCHv2 08/25] diff.c: migrate emit_line_checked to use emit_diff_symbol

2017-06-30 Thread Stefan Beller
Add a new flags field to emit_diff_symbol, that will be used by context lines for: * white space rules that are applicable (The first 12 bits) Take a note in cahe.c as well, when this ws rules are extended we have to fix the bits in the flags field. * how the rules are evaluated (actually this

[PATCHv2 04/25] diff.c: introduce emit_diff_symbol

2017-06-30 Thread Stefan Beller
In a later patch we want to buffer all output before emitting it as a new feature ("markup moved lines") conceptually cannot be implemented in a single pass over the output. There are different approaches to buffer all output such as: * Buffering on the char level, i.e. we'd have a char[] which wo

Re: [PATCHv2 22/25] diff.c: color moved lines differently

2017-06-30 Thread Junio C Hamano
Stefan Beller writes: > +static int next_byte(const char **cp, const char **endp, > + const struct diff_options *diffopt) > +{ > + int retval; > + > + if (*cp > *endp) > + return -1; > + > + if (DIFF_XDL_TST(diffopt, IGNORE_WHITESPACE_CHANGE)) { > +

Re: [PATCHv2 22/25] diff.c: color moved lines differently

2017-06-30 Thread Stefan Beller
On Fri, Jun 30, 2017 at 2:11 PM, Junio C Hamano wrote: >> + return (int)' '; > > Do we need a cast here? No, I figured it is good to have it here explicitly, though. We can drop that if you have strong preferences one way or another. > >> +static unsigned get_string_hash(struct emitt

Re: [PATCH v9 0/7] convert: add "status=delayed" to filter process protocol

2017-06-30 Thread Junio C Hamano
Will queue. I personally feel that this is polished enough for 'next'. Thanks.

  1   2   >