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

2017-07-16 Thread William Duclot
x27;t 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 --- Those new messages have been written thanks to Junio feedbacks and users tests with a few inexperienced git users.

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

2017-07-10 Thread William Duclot
Junio C Hamano writes: > William Duclot 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=' > > ' > > ok_to_skip_p

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

2017-07-09 Thread William Duclot
x27;t 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 --- While I do not expect that this V1 wording will be to the liking of everyone, I think (know?) that the heart of t

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 allocated memory",

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 writes: > > > On Fri, Jun 03, 2016 at 08:50:50AM -0700, Junio C Hamano wrote: > >> William Duclot writes: > >> > >> > Here I have to disagree (with you and Junio): the I

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 writes: > >> +#define MAX_ALLOC(a, b) (((a)>(b))?(a):(b)) > > I do not see why this macro is called MAX_ALLOC(); is there anything > "alloc" specific to what this does? You may

[PATCH V2 0/3] strbuf: improve API

2016-06-06 Thread William Duclot
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 Signed-off-by: Simon Rabourg Signed-off-by: Matthieu Moy --- Changes since V1: * Use the parser API

[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 Signed-off-by: Simon Rabourg Signed-off-by: Ma

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

2016-06-06 Thread William Duclot
are all mine. Signed-off by: William Duclot Signed-off by: Simon Rabourg Signed-off by: Matthieu Moy --- Changes since V1: * Refactoring: use a `strbuf_wrap_internal()` static function * Use bit fields for flags * Completing documentation & commit message * Rename `strbuf_

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 writes: > > > Here I have to disagree (with you and Junio): the IPATTERN is > > case-insensitive only on the "pattern" regex, not the "word_regex" > > regex. > &

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 "fixe

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

2016-06-03 Thread William Duclot
column 1, pick the whole line Credits to Johannes Sixt (j...@kdbg.org) for the pattern regex and most of the tests. Signed-off-by: William Duclot Signed-off-by: Matthieu Moy --- Changes since V3: - Add a few tests - Remove a redondant test - Handle trailing spaces

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
pick the whole line Credits to Johannes Sixt (j...@kdbg.org) for the pattern regex and most of the tests. Signed-off-by: William Duclot Signed-off-by: Matthieu Moy --- Changes since V2: - pattern regex has changed - more tests Documentation/gitattributes.txt | 2 ++ t/t4018-diff-funcname

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 have the case where the

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 allocation (i.e. .alloc, not .len), the user of >

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 w

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 can > contain more d

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

2016-05-30 Thread William Duclot
Matthieu Moy writes: > William Duclot writes: > >> Matthieu Moy writes: >>>> +/** >>>> + * Allow the caller to give a pre-allocated piece of memory for the >>>> strbuf >>>> + * to use and indicate that the strbuf must use exclusivel

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

2016-05-30 Thread William Duclot
Matthieu Moy writes: > William Duclot writes: > >> @@ -20,16 +28,37 @@ char strbuf_slopbuf[1]; >> >> void strbuf_init(struct strbuf *sb, size_t hint) >> { >> +sb->flags = 0; >> sb->alloc = sb->len = 0; >> sb->buf = s

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

2016-05-30 Thread William Duclot
Johannes Schindelin 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 >> >> void f() >> { >> char path[PATH_MAX]; >>

[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
implementation and bugs are all mine. Signed-off by: William Duclot Signed-off by: Simon Rabourg Signed-off by: Matthieu Moy --- strbuf.c | 68 ++ strbuf.h | 31 +-- t/helper/test-strbuf.c | 42 +++

[PATCH 0/2] strbuf: improve API

2016-05-30 Thread William Duclot
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 writes: > William Duclot 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 PATTERNS(). > > Did you notice that HTML pattern has to do an [Hh] tha

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 us

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

2016-05-24 Thread William Duclot
XML (class or id). Diffing ".class1" and ".class2" must show that the class name is changed, but we still are selecting a class. Signed-off-by: William Duclot Signed-off-by: Matthieu Moy --- changes since v1: Fix a typo in the word_regex ("A-F" => "A-Z").

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: > (As

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

2016-05-20 Thread William Duclot
XML (class or id). Diffing ".class1" and ".class2" must show that the class name is changed, but we still are selecting a class. Signed-off-by: William Duclot Signed-off-by: Matthieu Moy --- Documentation/gitattributes.txt | 2 ++ t/t4018-diff-funcname.sh| 1 + t/t4

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 ran

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 "doesn't add much to the *commit

[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 test