[PATCH] rebase: make resolve message clearer for inexperienced users

2017-07-16 Thread William Duclot
handle with "--abort". This commit answer those two points by detailling the resolution process and by avoiding cryptic git linguo. Signed-off-by: William Duclot <william.duc...@gmail.com> --- Those new messages have been written thanks to Junio feedbacks and users tests with a few i

Re: [PATCH/RFC] rebase: make resolve message clearer for inexperienced users

2017-07-10 Thread William Duclot
Junio C Hamano writes: > William Duclot <william.duc...@gmail.com> writes: > > > diff --git a/git-rebase.sh b/git-rebase.sh > > index 2cf73b88e..50457f687 100755 > > --- a/git-rebase.sh > > +++ b/git-rebase.sh > > @@ -55,9 +55,10 @@ LF=' > >

[PATCH/RFC] rebase: make resolve message clearer for inexperienced users

2017-07-09 Thread William Duclot
handle with "--abort". This commit answer those two points by detailling the resolution process and by avoiding cryptic git linguo. Signed-off-by: William Duclot <william.duc...@gmail.com> --- While I do not expect that this V1 wording will be to the liking of everyon

Re: [PATCH V2 3/3] strbuf: allow to use preallocated memory

2016-06-07 Thread William Duclot
On Mon, Jun 06, 2016 at 04:24:53PM -0700, Junio C Hamano wrote: > Jeff King writes: > >>> I think that call should reset line.buf to the original buffer on >>> the stack, instead of saying "Ok, I'll ignore the original memory >>> not owned by us and instead keep pointing at the

Re: [PATCH] userdiff: add built-in pattern for CSS

2016-06-06 Thread William Duclot
On Mon, Jun 06, 2016 at 11:00:38AM -0700, Junio C Hamano wrote: > William Duclot <william.duc...@ensimag.grenoble-inp.fr> writes: > > > On Fri, Jun 03, 2016 at 08:50:50AM -0700, Junio C Hamano wrote: > >> William Duclot <william.duc...@ensimag.grenoble-inp.fr>

Re: [PATCH V2 3/3] strbuf: allow to use preallocated memory

2016-06-06 Thread William Duclot
On Mon, Jun 06, 2016 at 10:19:07AM -0700, Junio C Hamano wrote: > William Duclot <william.duc...@ensimag.grenoble-inp.fr> writes: > >> +#define MAX_ALLOC(a, b) (((a)>(b))?(a):(b)) > > I do not see why this macro is called MAX_ALLOC(); is there anything > "allo

[PATCH V2 3/3] strbuf: allow to use preallocated memory

2016-06-06 Thread William Duclot
by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off by: Simon Rabourg <simon.rabo...@ensimag.grenoble-inp.fr> Signed-off by: Matthieu Moy <matthieu@grenoble-inp.fr> --- Changes since V1: * Refactoring: use a `strbuf_wrap_internal()` static function

[PATCH V2 0/3] strbuf: improve API

2016-06-06 Thread William Duclot
is also preparatory: rename a function for the third patch. * Most of the work is made in the third patch: handle pre-allocated memory, extend the API, document it and test it. As said in the third commit message, the idea comes from Michael Haggerty. William Duclot (3): strbuf: add tests

[PATCH V2 1/3] strbuf: add tests

2016-06-06 Thread William Duclot
Test the strbuf API. Being used throughout all Git the API could be considered tested, but adding specific tests makes it easier to improve and extend the API. Signed-off-by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off-by: Simon Rabourg <simon.rabo...@ensimag

[PATCH V2 2/3] pretty.c: rename strbuf_wrap() function

2016-06-06 Thread William Duclot
The function strbuf_wrap() is not part of the strbuf API, yet prevent to extend the API to include wrapping functions. Renaming it to something more specific allow to use "strbuf_wrap" for the strbut API. Signed-off-by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Sign

Re: [PATCH] userdiff: add built-in pattern for CSS

2016-06-06 Thread William Duclot
On Fri, Jun 03, 2016 at 08:50:50AM -0700, Junio C Hamano wrote: > William Duclot <william.duc...@ensimag.grenoble-inp.fr> writes: > > > Here I have to disagree (with you and Junio): the IPATTERN is > > case-insensitive only on the "pattern" regex, not the &q

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-06-03 Thread William Duclot
On Tue, May 31, 2016 at 06:05:45AM +0200, Michael Haggerty wrote: > When reading this patch series, I found I had trouble remembering > whether "preallocated" meant "preallocated and movable" or "preallocated > and immovable". So maybe we should brainstorm alternatives to > "preallocated" and

[PATCH] userdiff: add built-in pattern for CSS

2016-06-03 Thread William Duclot
o Johannes Sixt (j...@kdbg.org) for the pattern regex and most of the tests. Signed-off-by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <matthieu@grenoble-inp.fr> --- Changes since V3: - Add a few tests - Remove a redondant test -

Re: [PATCH] userdiff: add built-in pattern for CSS

2016-06-03 Thread William Duclot
On Fri, Jun 03, 2016 at 07:52:45AM +0200, Johannes Sixt wrote: > Am 03.06.2016 um 00:48 schrieb William Duclot: >>Logic behind the "pattern" regex is: > > The name of the macro parameter is "pattern", but the actual meaning > is "function n

[PATCH] userdiff: add built-in pattern for CSS

2016-06-02 Thread William Duclot
o Johannes Sixt (j...@kdbg.org) for the pattern regex and most of the tests. Signed-off-by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <matthieu@grenoble-inp.fr> --- Changes since V2: - pattern regex has changed - more tests Documentati

Re: [PATCH 0/2] strbuf: improve API

2016-06-02 Thread William Duclot
On Thu, Jun 02, 2016 at 02:58:22PM +0200, Matthieu Moy wrote: > Michael Haggerty writes: > >> 1. The amount of added code complexity is small and quite >>encapsulated. > > Actually, STRBUF_OWNS_MEMORY can even be seen as a simplification if > done properly: we already

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-31 Thread William Duclot
On Tue, May 31, 2016 at 05:54:59PM +0200, Matthieu Moy wrote: > William writes: > > > On Mon, May 30, 2016 at 11:34:42PM -0700, Junio C Hamano wrote: > > > >> As long as your "on stack strbuf" allows lengthening the string > >> beyond the initial

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-31 Thread William Duclot
On Tue, May 31, 2016 at 06:05:45AM +0200, Michael Haggerty wrote: > On 05/30/2016 02:52 PM, Matthieu Moy wrote: > > [...] > > I feel bad bikeshedding about names, especially since you took some of > the original names from my RFC. But names are very important, so I think > it's worth considering

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Mike Hommey writes: >> struct strbuf { >> +unsigned int flags; >> size_t alloc; >> size_t len; >> char *buf; >> }; > > Depending whether the size of strbuf matters, it /might/ be worth > considering some packing here. malloc() usually returns buffers that

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Matthieu Moy <matthieu@grenoble-inp.fr> writes: > William Duclot <william.duc...@ensimag.grenoble-inp.fr> writes: > >> Matthieu Moy <matthieu@grenoble-inp.fr> writes: >>>> +/** >>>> + * Allow the caller to give a pre-allocat

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Matthieu Moy <matthieu@grenoble-inp.fr> writes: > William Duclot <william.duc...@ensimag.grenoble-inp.fr> writes: > >> @@ -20,16 +28,37 @@ char strbuf_slopbuf[1]; >> >> void strbuf_init(struct strbuf *sb, size_t hint) >> { >> +sb->fla

Re: [PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
Johannes Schindelin <johannes.schinde...@gmx.de> writes: > On Mon, 30 May 2016, William Duclot wrote: > >> It is unfortunate that it is currently impossible to use a strbuf >> without doing a memory allocation. So code like >> >> voi

[PATCH 1/2] strbuf: add tests

2016-05-30 Thread William Duclot
Test the strbuf API. Being used throughout all Git the API could be considered tested, but adding specific tests makes it easier to improve and extend the API. --- Makefile | 1 + t/helper/test-strbuf.c | 69 ++ t/t0082-strbuf.sh

[PATCH 2/2] strbuf: allow to use preallocated memory

2016-05-30 Thread William Duclot
ed-off by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off by: Simon Rabourg <simon.rabo...@ensimag.grenoble-inp.fr> Signed-off by: Matthieu Moy <matthieu@grenoble-inp.fr> --- strbuf.c | 68 ++ str

[PATCH 0/2] strbuf: improve API

2016-05-30 Thread William Duclot
in the second patch: handle pre-allocated memory, extend the API, document it and test it. As said in the second commit, the idea comes from Michael Haggerty. William Duclot (2): strbuf: add tests strbuf: allow to use preallocated memory Makefile | 1 + strbuf.c

Re: [PATCH] userdiff: add built-in pattern for CSS

2016-05-27 Thread William Duclot
Junio C Hamano <gits...@pobox.com> writes: > William Duclot <william.duc...@ensimag.grenoble-inp.fr> writes: > >> As the CSS pattern >> does not deal with letters at all it seemed sensible to me to follow >> the example of the HTML pattern, which use PATTE

Re: [PATCH] userdiff: add built-in pattern for CSS

2016-05-24 Thread William Duclot
> It is not a big deal for a small single-patch topic like this, but > it often is hard to reviewers if you do not respond to comments you > received and instead just send a new version of the patch with > "changes since..." comment. Please make it a habit to do both. Apologies, I am not quite

[PATCH] userdiff: add built-in pattern for CSS

2016-05-24 Thread William Duclot
lass1" and ".class2" must show that the class name is changed, but we still are selecting a class. Signed-off-by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <matthieu@grenoble-inp.fr> --- changes since v1: Fix a typo in the word

Re: run-command: output owner picking strategy

2016-05-20 Thread William Duclot
> When running in parallel we already may be out of order > (relative to serial processing). See the second example in the > commit message to produce a different order. Right, I could (should) have understood that by myself. > Consider we scheduled tasks to be run in 3 parallel processes: >

[PATCH] userdiff: add built-in pattern for CSS

2016-05-20 Thread William Duclot
lass1" and ".class2" must show that the class name is changed, but we still are selecting a class. Signed-off-by: William Duclot <william.duc...@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <matthieu@grenoble-inp.fr> --- Documentation/gitattributes.txt |

run-command: output owner picking strategy

2016-05-20 Thread William Duclot
Hi, I stumbled upon this piece of code (run-command.c:pp_collect_finish()), picking the owner of the output amongst parallel processes (introduced by Stephan Beller in commit c553c72eed64b5f7316ce227f6d5d783eae6f2ed) /* * Pick next process to output live. * NEEDSWORK: * For now we pick it

Re: [PATCH/RFC] Add userdiff built-in pattern for CSS code

2016-05-19 Thread William Duclot
> On Thu, May 19, 2016 at 10:45 AM, Matthieu Moy > wrote: > >> Add the info in documentation that CSS is now built-in. > > > > This doesn't add much to the patch (we can already see that from the patch > > itself). I'd remove it. > > I think you meant to say this

[PATCH/RFC] Add userdiff built-in pattern for CSS code

2016-05-19 Thread William Duclot
CSS is widely used, motivating it being included as a built-in pattern. It must be noted that the word_regex for CSS (i.e. the regex defining what is a word in the language) does not consider '.' and '#' characters (in CSS selectors) to be part of the word. This behavior is documented by the