Re: RFC: --force-with-lease default behaviour

2017-01-04 Thread G. Sylvie Davies
On Wed, Jan 4, 2017 at 6:34 PM, G. Sylvie Davies wrote: > Right now the default variant does this: > >> --force-with-lease alone, without specifying the details, will protect all >> remote refs that are going to be updated by requiring their current value to >> be the

RFC: --force-with-lease default behaviour

2017-01-04 Thread G. Sylvie Davies
Right now the default variant does this: > --force-with-lease alone, without specifying the details, will protect all > remote refs that are going to be updated by requiring their current value to > be the same as the remote-tracking branch we have for them. The problem is people sometimes run

Re: [PATCHv5] pathspec: give better message for submodule related pathspec error

2017-01-04 Thread Stefan Beller
> I haven't taken a through look at this patch but I think you may want to > base it off of 'origin/bw/pathspec-cleanup' series as the changes made in this > patch now conflict with that series. eh right, I forgot to mention this in the notes, it requires sb/submodule-embed-gitdir as well, so

Re: [PATCHv5] pathspec: give better message for submodule related pathspec error

2017-01-04 Thread Brandon Williams
On 01/04, Stefan Beller wrote: > Every once in a while someone complains to the mailing list to have > run into this weird assertion[1]. The usual response from the mailing > list is link to old discussions[2], and acknowledging the problem > stating it is known. > > This patch accomplishes two

[PATCHv5] pathspec: give better message for submodule related pathspec error

2017-01-04 Thread Stefan Beller
Every once in a while someone complains to the mailing list to have run into this weird assertion[1]. The usual response from the mailing list is link to old discussions[2], and acknowledging the problem stating it is known. This patch accomplishes two things: 1. Switch assert() to die("BUG")

Re: [PATCH 2/2] pathspec: give better message for submodule related pathspec error

2017-01-04 Thread Stefan Beller
On Tue, Jan 3, 2017 at 11:55 PM, Jeff King wrote: > As this last bit is quoted from me, I won't deny that it's brilliant as > usual. obviously. :) > > But as this commit message needs to stand on its own, rather than as part of a > larger discussion thread, it might be worth

[PATCH v5 5/5] real_path: canonicalize directory separators in root parts

2017-01-04 Thread Brandon Williams
From: Johannes Sixt When an absolute path is resolved, resolution begins at the first path component after the root part. The root part is just copied verbatim, because it must not be inspected for symbolic links. For POSIX paths, this is just the initial slash, but on Windows,

[PATCH v5 2/5] real_path: convert real_path_internal to strbuf_realpath

2017-01-04 Thread Brandon Williams
Change the name of real_path_internal to strbuf_realpath. In addition push the static strbuf up to its callers and instead take as a parameter a pointer to a strbuf to use for the final result. This change makes strbuf_realpath reentrant. Signed-off-by: Brandon Williams ---

[PATCH v5 1/5] real_path: resolve symlinks by hand

2017-01-04 Thread Brandon Williams
The current implementation of real_path uses chdir() in order to resolve symlinks. Unfortunately this isn't thread-safe as chdir() affects a process as a whole and not just an individual thread. Instead perform the symlink resolution by hand so that the calls to chdir() can be removed, making

[PATCH v5 4/5] real_path: have callers use real_pathdup and strbuf_realpath

2017-01-04 Thread Brandon Williams
Migrate callers of real_path() who duplicate the return value to use real_pathdup or strbuf_realpath. Signed-off-by: Brandon Williams --- builtin/init-db.c | 6 +++--- environment.c | 2 +- setup.c | 13 - sha1_file.c | 2 +- submodule.c

[PATCH v5 3/5] real_path: create real_pathdup

2017-01-04 Thread Brandon Williams
Create real_pathdup which returns a caller owned string of the resolved realpath based on the provide path. Signed-off-by: Brandon Williams --- abspath.c | 13 + cache.h | 1 + 2 files changed, 14 insertions(+) diff --git a/abspath.c b/abspath.c index

[PATCH v5 0/5] road to reentrant real_path

2017-01-04 Thread Brandon Williams
changes in v5: * set errno to ELOOP when MAXSYMLINKS is exceded. * revert to use MAXSYMLINKS instead of MAXDEPTH. * If the OS hasn't defined MAXSYMLINKS, use a fallback value of 32. Brandon Williams (4): real_path: resolve symlinks by hand real_path: convert real_path_internal to

Re: [PATCH v4 0/5] road to reentrant real_path

2017-01-04 Thread Brandon Williams
On 01/04, Jacob Keller wrote: > On Wed, Jan 4, 2017 at 10:22 AM, Stefan Beller wrote: > > On Wed, Jan 4, 2017 at 10:13 AM, Brandon Williams wrote: > >> On 01/04, Jeff King wrote: > >>> On Wed, Jan 04, 2017 at 07:56:02AM +0100, Torsten Bögershausen wrote: >

Re: [PATCH v4 0/5] road to reentrant real_path

2017-01-04 Thread Jacob Keller
On Wed, Jan 4, 2017 at 10:22 AM, Stefan Beller wrote: > On Wed, Jan 4, 2017 at 10:13 AM, Brandon Williams wrote: >> On 01/04, Jeff King wrote: >>> On Wed, Jan 04, 2017 at 07:56:02AM +0100, Torsten Bögershausen wrote: >>> >>> > On 04.01.17 01:48, Jeff King

Re: [PATCH 2/2] pathspec: give better message for submodule related pathspec error

2017-01-04 Thread Brandon Williams
On 01/04, Stefan Beller wrote: > On Tue, Jan 3, 2017 at 11:55 PM, Jeff King wrote: > > But as this commit message needs to stand on its own, rather than as part > > of a > > larger discussion thread, it might be worth expanding "one of the cases" > > here. And talking about what's

Re: [PATCH 2/4] t7610: make tests more independent and debuggable

2017-01-04 Thread Stefan Beller
On Tue, Jan 3, 2017 at 4:50 PM, Richard Hansen wrote: > If a test fails it might leave the repository in a strange state. Add > 'git reset --hard' at the beginning of each test to increase the odds > of passing when an earlier test fails. So each test is cleaning up the

Re: [PATCH 2/2] pathspec: give better message for submodule related pathspec error

2017-01-04 Thread Stefan Beller
On Tue, Jan 3, 2017 at 11:55 PM, Jeff King wrote: > But as this commit message needs to stand on its own, rather than as part of a > larger discussion thread, it might be worth expanding "one of the cases" > here. And talking about what's happening to the other cases. > > Like: > >

Re: [PATCH v4 0/5] road to reentrant real_path

2017-01-04 Thread Stefan Beller
On Wed, Jan 4, 2017 at 10:13 AM, Brandon Williams wrote: > On 01/04, Jeff King wrote: >> On Wed, Jan 04, 2017 at 07:56:02AM +0100, Torsten Bögershausen wrote: >> >> > On 04.01.17 01:48, Jeff King wrote: >> > > On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote: >>

Re: [PATCH v4 4/5] real_path: have callers use real_pathdup and strbuf_realpath

2017-01-04 Thread Brandon Williams
On 01/03, Jacob Keller wrote: > On Tue, Jan 3, 2017 at 11:09 AM, Brandon Williams wrote: > > Migrate callers of real_path() who duplicate the retern value to use > > real_pathdup or strbuf_realpath. > > Nit: s/retern/return Thanks for catching that, I'll fix that in the next

Re: [PATCH v4 0/5] road to reentrant real_path

2017-01-04 Thread Brandon Williams
On 01/04, Jeff King wrote: > On Wed, Jan 04, 2017 at 07:56:02AM +0100, Torsten Bögershausen wrote: > > > On 04.01.17 01:48, Jeff King wrote: > > > On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote: > > > > > >> Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back

Re: [PATCH v4 1/4] Avoid Coverity warning about unfree()d git_exec_path()

2017-01-04 Thread Stefan Beller
On Tue, Jan 3, 2017 at 1:33 PM, Johannes Schindelin wrote: > > This patch was originally only to appease Coverity, but it actually *does* > plug a very real memory leak: previously, *every* call to git_exec_path() > *possibly* returned a newly-malloc()ed buffer. Now,

[PATCH v5 02/16] dir: remove struct path_simplify

2017-01-04 Thread Brandon Williams
Teach simplify_away() and exclude_matches_pathspec() to handle struct pathspec directly, eliminating the need for the struct path_simplify. Also renamed the len parameter to pathlen in exclude_matches_pathspec() to match the parameter names used in simplify_away(). Signed-off-by: Brandon

[PATCH v5 07/16] pathspec: remove unused variable from unsupported_magic

2017-01-04 Thread Brandon Williams
Removed unused variable 'n' from the 'unsupported_magic()' function. Signed-off-by: Brandon Williams --- pathspec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pathspec.c b/pathspec.c index b8faa8f46..b9a3819d6 100644 --- a/pathspec.c +++

[PATCH v5 03/16] dir: convert fill_directory to use the pathspec struct interface

2017-01-04 Thread Brandon Williams
Convert 'fill_directory()' to use the pathspec struct interface from using the '_raw' entry in the pathspec struct. Signed-off-by: Brandon Williams --- dir.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dir.c b/dir.c index

[PATCH v5 05/16] pathspec: remove the deprecated get_pathspec function

2017-01-04 Thread Brandon Williams
Now that all callers of the old 'get_pathspec' interface have been migrated to use the new pathspec struct interface it can be removed from the codebase. Since there are no more users of the '_raw' field in the pathspec struct it can also be removed. This patch also removes the old functionality

[PATCH v5 01/16] mv: remove use of deprecated 'get_pathspec()'

2017-01-04 Thread Brandon Williams
Convert the 'internal_copy_pathspec()' function to 'prefix_path()' instead of using the deprecated 'get_pathspec()' interface. Also, rename 'internal_copy_pathspec()' to 'internal_prefix_pathspec()' to be more descriptive of what the funciton is actually doing. In addition to this, fix a memory

[PATCH v5 06/16] pathspec: copy and free owned memory

2017-01-04 Thread Brandon Williams
The 'original' string entry in a pathspec_item is only duplicated some of the time, instead always make a copy of the original and take ownership of the memory. Since both 'match' and 'original' string entries in a pathspec_item are owned by the pathspec struct, they need to be freed when

[PATCH v5 04/16] ls-tree: convert show_recursive to use the pathspec struct interface

2017-01-04 Thread Brandon Williams
Convert 'show_recursive()' to use the pathspec struct interface from using the '_raw' entry in the pathspec struct. Signed-off-by: Brandon Williams --- builtin/ls-tree.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/builtin/ls-tree.c

[PATCH v5 00/16] pathspec cleanup

2017-01-04 Thread Brandon Williams
Changes in v5: * Move GUARD_PATHSPEC to prevent checking if pathspec is null twice. * Mark a string containing 'mnemonic' for translation. Brandon Williams (16): mv: remove use of deprecated 'get_pathspec()' dir: remove struct path_simplify dir: convert fill_directory to use the pathspec

[PATCH v5 16/16] pathspec: rename prefix_pathspec to init_pathspec_item

2017-01-04 Thread Brandon Williams
Give a more relevant name to the prefix_pathspec function as it does more than just prefix a pathspec element. Signed-off-by: Brandon Williams --- pathspec.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/pathspec.c b/pathspec.c

[PATCH v5 14/16] pathspec: create strip submodule slash helpers

2017-01-04 Thread Brandon Williams
Factor out the logic responsible for stripping the trailing slash on pathspecs referencing submodules into its own function. Signed-off-by: Brandon Williams --- pathspec.c | 68 ++ 1 file changed, 42 insertions(+),

[PATCH v5 10/16] pathspec: factor global magic into its own function

2017-01-04 Thread Brandon Williams
Create helper functions to read the global magic environment variables in additon to factoring out the global magic gathering logic into its own function. Signed-off-by: Brandon Williams --- pathspec.c | 127 + 1

[PATCH v5 12/16] pathspec: create parse_long_magic function

2017-01-04 Thread Brandon Williams
Factor out the logic responsible for parsing long magic into its own function. As well as hoist the prefix check logic outside of the inner loop as there isn't anything that needs to be done after matching "prefix:". Signed-off-by: Brandon Williams --- pathspec.c | 92

[PATCH v5 11/16] pathspec: create parse_short_magic function

2017-01-04 Thread Brandon Williams
Factor out the logic responsible for parsing short magic into its own function. Signed-off-by: Brandon Williams --- pathspec.c | 54 -- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/pathspec.c b/pathspec.c

[PATCH v5 09/16] pathspec: simpler logic to prefix original pathspec elements

2017-01-04 Thread Brandon Williams
The logic used to prefix an original pathspec element with 'prefix' magic is more general purpose and can be used for more than just short magic. Remove the extra code paths and rename 'prefix_short_magic' to 'prefix_magic' to better indicate that it can be used in more general situations. Also,

[PATCH v5 08/16] pathspec: always show mnemonic and name in unsupported_magic

2017-01-04 Thread Brandon Williams
For better clarity, always show the mnemonic and name of the unsupported magic being used. This lets users have a more clear understanding of what magic feature isn't supported. And if they supplied a mnemonic, the user will be told what its corresponding name is which will allow them to more

[PATCH v5 13/16] pathspec: create parse_element_magic helper

2017-01-04 Thread Brandon Williams
Factor out the logic responsible for the magic in a pathspec element into its own function. Also avoid calling into the parsing functions when `PATHSPEC_LITERAL_PATH` is specified since it causes magic to be ignored and all paths to be treated as literals. Signed-off-by: Brandon Williams

[PATCH v5 15/16] pathspec: small readability changes

2017-01-04 Thread Brandon Williams
A few small changes to improve readability. This is done by grouping related assignments, adding blank lines, ensuring lines are <80 characters, and adding additional comments. Signed-off-by: Brandon Williams --- pathspec.c | 25 +++-- 1 file changed, 15

Re: [PATCH v4 00/16] pathspec cleanup

2017-01-04 Thread Brandon Williams
On 01/04, Brandon Williams wrote: > On 01/04, Duy Nguyen wrote: > > On Wed, Jan 4, 2017 at 1:42 AM, Brandon Williams wrote: > > > diff --git a/dir.c b/dir.c > > > index 15f7c9993..e8ddd7f8a 100644 > > > --- a/dir.c > > > +++ b/dir.c > > > @@ -1353,6 +1353,15 @@ static int

Re: [PATCH v4 00/16] pathspec cleanup

2017-01-04 Thread Brandon Williams
On 01/04, Duy Nguyen wrote: > On Wed, Jan 4, 2017 at 1:42 AM, Brandon Williams wrote: > > diff --git a/dir.c b/dir.c > > index 15f7c9993..e8ddd7f8a 100644 > > --- a/dir.c > > +++ b/dir.c > > @@ -1353,6 +1353,15 @@ static int simplify_away(const char *path, int > > pathlen, > >

Re: Preserve/Prune Old Pack Files

2017-01-04 Thread Martin Fick
I am replying to this email across lists because I wanted to highlight to the git community this jgit change to repacking that we have up for review https://git.eclipse.org/r/#/c/87969/ This change introduces a new convention for how to preserve old pack files in a staging area

Re: [PATCH v4 00/16] pathspec cleanup

2017-01-04 Thread Duy Nguyen
On Wed, Jan 4, 2017 at 1:42 AM, Brandon Williams wrote: > diff --git a/dir.c b/dir.c > index 15f7c9993..e8ddd7f8a 100644 > --- a/dir.c > +++ b/dir.c > @@ -1353,6 +1353,15 @@ static int simplify_away(const char *path, int pathlen, > { > int i; > > + if (pathspec)

Re: [PATCH 2/2] dir.c: add retry logic to relocate_gitdir

2017-01-04 Thread Duy Nguyen
On Tue, Dec 20, 2016 at 6:19 AM, Stefan Beller wrote: >> On 12/19, Stefan Beller wrote: > This code is heavily inspired by refs/files-backend.c which upon > closer inspection only retries directory things within the git directory > (which is assumed to be accessed in parallel

Re: [RFC PATCH 0/5] Localise error headers

2017-01-04 Thread Duy Nguyen
On Wed, Jan 4, 2017 at 2:45 AM, Stefan Beller wrote: >> In this implementation, the gettext call for the header and the body are done >> in different places (error function vs. caller) but this call pattern seems >> to >> be the easiest variant for the caller, because the

Re: [PATCH v3 2/2] t9813: avoid using pipes

2017-01-04 Thread Pranit Bauva
Hey Luke, On Wed, Jan 4, 2017 at 2:41 PM, Luke Diamand wrote: > On 3 January 2017 at 19:57, Pranit Bauva wrote: >> The exit code of the upstream in a pipe is ignored thus we should avoid >> using it. By writing out the output of the git command to a

Re: [PATCH v4 1/4] Avoid Coverity warning about unfree()d git_exec_path()

2017-01-04 Thread Johannes Schindelin
Hi Stefan, On Tue, 3 Jan 2017, Stefan Beller wrote: > On Mon, Jan 2, 2017 at 8:22 AM, Johannes Schindelin > wrote: > > Technically, it is correct that git_exec_path() returns a possibly > > malloc()ed string. Practically, it is *sometimes* not malloc()ed. So > >

Re: [PATCH v2] git-p4: do not pass '-r 0' to p4 commands

2017-01-04 Thread Luke Diamand
On 3 January 2017 at 20:02, Ori Rawlings wrote: > Looks good to me. And me. > > > Ori Rawlings

Re: [PATCH v3 2/2] t9813: avoid using pipes

2017-01-04 Thread Luke Diamand
On 3 January 2017 at 19:57, Pranit Bauva wrote: > The exit code of the upstream in a pipe is ignored thus we should avoid > using it. By writing out the output of the git command to a file, we can > test the exit codes of both the commands. Do we also need to fix

Re: [PATCH 2/2] giteveryday: unbreak rendering with AsciiDoctor

2017-01-04 Thread Jeff King
On Mon, Jan 02, 2017 at 05:04:05PM +0100, Johannes Schindelin wrote: > The "giteveryday" document has a callout list that contains a code > block. This is not a problem for AsciiDoc, but AsciiDoctor sadly was > explicitly designed *not* to render this correctly [*1*]. The symptom is > an

Re: [PATCH 1/2] asciidoctor: fix user-manual to be built by `asciidoctor`

2017-01-04 Thread Jeff King
On Mon, Jan 02, 2017 at 05:03:57PM +0100, Johannes Schindelin wrote: > From: =?UTF-8?q?=EB=A7=88=EB=88=84=EC=97=98?= > > The `user-manual.txt` is designed as a `book` but the `Makefile` wants > to build it as an `article`. This seems to be a problem when building > the