Re: Wildcard URL config matching

2018-11-07 Thread Patrick Steinhardt
Hi Brian, On Mon, Nov 05, 2018 at 08:56:52PM +, brian m. carlson wrote: > In a272b9e70a ("urlmatch: allow globbing for the URL host part", > 2017-01-31), we added support for wildcard matching for URLs when > reading from .git/config. Now it's possible to specify an option like >

Re: [PATCH 1/1] read-cache: update index format default to v4

2018-09-25 Thread Patrick Steinhardt
On Mon, Sep 24, 2018 at 11:32:23PM +0200, SZEDER Gábor wrote: > On Mon, Sep 24, 2018 at 02:15:30PM -0700, Derrick Stolee via GitGitGadget > wrote: > > From: Derrick Stolee > > > > The index v4 format has been available since 2012 with 9d22778 > > "reach-cache.c: write prefix-compressed names in

Re: Git Open Source Weekend London 11th/12th November

2017-11-07 Thread Patrick Steinhardt
> Hi Patrick, > > libgit2 tasks are welcome! Feel free to bring your ideas > along. Also, Peff could add some to the task list if they are > appropriate for others to participate on. That's nice. I don't want to populate the list with too much libgit2 specific things, but we do have a summary

Re: Git Open Source Weekend London 11th/12th November

2017-11-05 Thread Patrick Steinhardt
On Wed, Nov 01, 2017 at 04:36:24PM +, Thomas Gummerer wrote: > Hi, > > Bloomberg is hosting an Open Source Weekend in London on the 11th > & 12th November 2017 to contribute to the Git project. We have > also confirmed that Peff will be amongst the mentors on hand to > guide attendees

[PATCH] git-stash: fix pushing stash with pathspec from subdir

2017-06-13 Thread Patrick Steinhardt
which the command is being run. Fix the shortcoming by storing the prefix previous to the call to `cd_to_toplevel` and then subsequently using `git rev-parse --prefix` to correctly resolve the pathspec. Add a test to catch future breakage of this usecase. Signed-off-by: Patrick Steinhardt &l

Re: [PATCH v2] pathspec: honor `PATHSPEC_PREFIX_ORIGIN` with empty prefix

2017-04-12 Thread Patrick Steinhardt
On Tue, Apr 04, 2017 at 11:16:56AM +0200, Patrick Steinhardt wrote: > Previous to commit 5d8f084a5 (pathspec: simpler logic to prefix original > pathspec elements, 2017-01-04), we were always using the computed > `match` variable to perform pathspec matching whenever > `PATHSPEC_P

Re: [PATCH] pathspec: always honor `PATHSPEC_PREFIX_ORIGIN` flag

2017-04-04 Thread Patrick Steinhardt
On Mon, Apr 03, 2017 at 09:26:48AM -0700, Brandon Williams wrote: > On 04/03, Patrick Steinhardt wrote: > > Previous to commit 5d8f084a5 (pathspec: simpler logic to prefix original > > pathspec elements, 2017-01-04), we were always using the computed > > `match` variabl

[PATCH v2] pathspec: honor `PATHSPEC_PREFIX_ORIGIN` with empty prefix

2017-04-04 Thread Patrick Steinhardt
other commands, it will result in a warning regarding deprecated empty pathspecs. By always adding the prefix magic, we will end up with at least the string ":(prefix:0)" and thus avoid the warning. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- This is the second version of [1]. It fi

[PATCH] pathspec: always honor `PATHSPEC_PREFIX_ORIGIN` flag

2017-04-03 Thread Patrick Steinhardt
s interactive add. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- pathspec.c | 6 +++--- t/t3701-add-interactive.sh | 20 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/pathspec.c b/pathspec.c index 303efda83..3193e45a6 100644 --- a/pathspec.c

[PATCH 2/2] docs/diffcore: unquote "Complete Rewrites" in headers

2017-02-28 Thread Patrick Steinhardt
it for our generated HTML pages. So fix the issue by simply dropping quotes inside of section headers, which is currently only done for the term "Complete Rewrites". Signed-off-by: Patrick Steinhardt <p...@pks.im> --- The obvious other route here would be to fix how the stylesheets

[PATCH 1/2] docs/diffcore: fix grammar in diffcore-rename header

2017-02-28 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <p...@pks.im> --- Documentation/gitdiffcore.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index 46bc6d077..cf009a187 100644 --- a/Documentation/gitdiffcore.txt

[PATCH] docs/git-gc: fix default value for `--aggressiveDepth`

2017-02-24 Thread Patrick Steinhardt
In commit 07e7dbf0d (gc: default aggressive depth to 50, 2016-08-11), the default aggressive depth of git-gc has been changed to 50. While git-config(1) has been updated to represent the new default value, git-gc(1) still mentions the old value. This patch fixes it. Signed-off-by: Patrick

[PATCH] worktree: fix option descriptions for `prune`

2017-02-06 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- builtin/worktree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 9a97e37a3..831fe058a 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -125,9

Re: What's cooking in git.git (Jan 2017, #06; Tue, 31)

2017-02-01 Thread Patrick Steinhardt
On Tue, Jan 31, 2017 at 02:45:40PM -0800, Junio C Hamano wrote: > * ps/urlmatch-wildcard (2017-01-31) 5 commits > . urlmatch: allow globbing for the URL host part > . urlmatch: include host in urlmatch ranking > . urlmatch: split host and port fields in `struct url_info` > . urlmatch: enable

[PATCH v5 0/5] urlmatch: allow wildcard-based matches

2017-01-31 Thread Patrick Steinhardt
had an embarassing bug because a variable was not properly initialized in all cases, leading to undefined behavior. I also verified that the patches work on top of 4e59582ff (Seventh batch for 2.12, 2017-01-23), where Junio reported the test failures. Regards Patrick Patrick Steinhardt (5

[PATCH v5 2/5] urlmatch: enable normalization of URLs with globs

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt <patrick.steinha...@elego.de> The `url_normalize` function is used to validate and normalize URLs. As such, it does not allow for some special characters to be part of the URLs that are to be normalized. As we want to allow using globs in some configuration keys

[PATCH v5 4/5] urlmatch: include host in urlmatch ranking

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt <patrick.steinha...@elego.de> In order to be able to rank positive matches by `urlmatch`, we inspect the path length and user part to decide whether a match is better than another match. As all other parts are matched exactly between both URLs, this is the correct

[PATCH v5 1/5] mailmap: add Patrick Steinhardt's work address

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt <patrick.steinha...@elego.de> Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ea59205b9 100644 --- a/.mailmap +++ b/.mailmap @@ -177,6 +17

[PATCH v5 3/5] urlmatch: split host and port fields in `struct url_info`

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt <patrick.steinha...@elego.de> The `url_info` structure contains information about a normalized URL with the URL's components being represented by different fields. The host and port part though are to be accessed by the same `host` field, so that getting th

[PATCH v5 5/5] urlmatch: allow globbing for the URL host part

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt <patrick.steinha...@elego.de> The URL matching function computes for two URLs whether they match not. The match is performed by splitting up the URL into different parts and then doing an exact comparison with the to-be-matched URL. The main user of `ur

Re: [PATCH v4 0/5] urlmatch: allow wildcard-based matches

2017-01-31 Thread Patrick Steinhardt
On Mon, Jan 30, 2017 at 02:52:00PM -0800, Junio C Hamano wrote: > Junio C Hamano <gits...@pobox.com> writes: > > > Patrick Steinhardt <patrick.steinha...@elego.de> writes: > > > >> - I realized that with my patches, "ranking" of URLs was broken. &

[PATCH v4 5/5] urlmatch: allow globbing for the URL host part

2017-01-27 Thread Patrick Steinhardt
y" for all direct subdomains of "https://example.com;, e.g. "https://foo.example.com;, but not "https://foo.bar.example.com;. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> Helped-by: Junio C Hamano <gits...@pobox.com> --- Documentation/config.tx

[PATCH v4 2/5] urlmatch: enable normalization of URLs with globs

2017-01-27 Thread Patrick Steinhardt
is subsequently called by `url_normalize` with `allow_globs=0`. As of now, this function is not used with globbing enabled. A caller will be added in the following commit. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- urlmatch.c | 14 -- 1 file changed, 12 inse

[PATCH v4 4/5] urlmatch: include host and port in urlmatch length

2017-01-27 Thread Patrick Steinhardt
to introduce wild cards for the domain part. When doing this, though, it does not make sense anymore to only compare the path lengths. Instead, we also want to compare the domain lengths to determine which of both URLs matches the host part more closely. Signed-off-by: Patrick Steinhardt <patrick.stei

[PATCH v4 3/5] urlmatch: split host and port fields in `struct url_info`

2017-01-27 Thread Patrick Steinhardt
`. This change makes it easier later on to treat host and port differently when introducing globs for domains. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- urlmatch.c | 16 urlmatch.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff

[PATCH v4 0/5] urlmatch: allow wildcard-based matches

2017-01-27 Thread Patrick Steinhardt
ly honored correctly. The tests are part of patches 4 and 5. You can find the interdiff below. Regards Patrick [1]: http://public-inbox.org/git/20170125095648.4116-1-patrick.steinha...@elego.de/T/#t Patrick Steinhardt (5): mailmap: add Patrick Steinhardt's work address urlmatch: enable nor

[PATCH v4 1/5] mailmap: add Patrick Steinhardt's work address

2017-01-27 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ea59205b9 100644 --- a/.mailmap +++ b/.mailmap @@ -177,6 +177,7 @@ Paolo Bonzini <bonz...@gnu.org> <paolo.bonz

Re: [PATCH v3 4/4] urlmatch: allow globbing for the URL host part

2017-01-26 Thread Patrick Steinhardt
On Thu, Jan 26, 2017 at 12:43:31PM -0800, Junio C Hamano wrote: > Patrick Steinhardt <patrick.steinha...@elego.de> writes: > > > The URL matching function computes for two URLs whether they match not. > > The match is performed by splitting up the URL into different

Re: [PATCH v2 4/4] urlmatch: allow globbing for the URL host part

2017-01-25 Thread Patrick Steinhardt
On Tue, Jan 24, 2017 at 05:52:39PM -, Philip Oakley wrote: > From: "Patrick Steinhardt" <patrick.steinha...@elego.de> > > a quick comment on the documentation part .. > > > The URL matching function computes for two URLs whether they match not. > >

[PATCH v3 3/4] urlmatch: split host and port fields in `struct url_info`

2017-01-25 Thread Patrick Steinhardt
`. This change makes it easier later on to treat host and port differently when introducing globs for domains. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- urlmatch.c | 16 urlmatch.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff

[PATCH v3 4/4] urlmatch: allow globbing for the URL host part

2017-01-25 Thread Patrick Steinhardt
. For example adding a configuration key `http.https://*.example.com.proxy` will match all subdomains of `https://example.com`. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- Documentation/config.txt | 5 - t/t1300-repo-config.sh

[PATCH v3 1/4] mailmap: add Patrick Steinhardt's work address

2017-01-25 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ea59205b9 100644 --- a/.mailmap +++ b/.mailmap @@ -177,6 +177,7 @@ Paolo Bonzini <bonz...@gnu.org> <paolo.bonz

[PATCH v3 2/4] urlmatch: enable normalization of URLs with globs

2017-01-25 Thread Patrick Steinhardt
is subsequently called by `url_normalize` with `allow_globs=0`. As of now, this function is not used with globbing enabled. A caller will be added in the following commit. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- urlmatch.c | 14 -- 1 file changed, 12 inse

[PATCH v3 0/4] urlmatch: allow regexp-based matches

2017-01-25 Thread Patrick Steinhardt
can find the interdiff below. Regards Patrick [1]: http://public-inbox.org/git/20170124170031.18069-1-patrick.steinha...@elego.de/T/#u Patrick Steinhardt (4): mailmap: add Patrick Steinhardt's work address urlmatch: enable normalization of URLs with globs urlmatch: split host and port

[PATCH v2 0/4] urlmatch: allow regexp-based matches

2017-01-24 Thread Patrick Steinhardt
as too much has changed between the two versions. Regards Patrick Patrick Steinhardt (4): mailmap: add Patrick Steinhardt's work address urlmatch: enable normalization of URLs with globs urlmatch: split host and port fields in `struct url_info` urlmatch: allow globbing for the URL host part

[PATCH v2 4/4] urlmatch: allow globbing for the URL host part

2017-01-24 Thread Patrick Steinhardt
. For example adding a configuration key `http.https://*.example.com.proxy` will match all subdomains of `https://example.com`. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- Documentation/config.txt | 5 - t/t1300-repo-config.sh

[PATCH v2 2/4] urlmatch: enable normalization of URLs with globs

2017-01-24 Thread Patrick Steinhardt
is subsequently called by `url_normalize` with `allow_globs=0`. As of now, this function is not used with globbing enabled. A caller will be added in the following commit. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- urlmatch.c | 14 -- 1 file changed, 12 inse

[PATCH v2 3/4] urlmatch: split host and port fields in `struct url_info`

2017-01-24 Thread Patrick Steinhardt
`. This change makes it easier later on to treat host and port differently when introducing globs for domains. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- urlmatch.c | 16 urlmatch.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff

[PATCH v2 1/4] mailmap: add Patrick Steinhardt's work address

2017-01-24 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ea59205b9 100644 --- a/.mailmap +++ b/.mailmap @@ -177,6 +177,7 @@ Paolo Bonzini <bonz...@gnu.org> <paolo.bonz

Re: [PATCH v1 0/2] urlmatch: allow regexp-based matches

2017-01-24 Thread Patrick Steinhardt
On Mon, Jan 23, 2017 at 11:53:43AM -0800, Junio C Hamano wrote: > Patrick Steinhardt <patrick.steinha...@elego.de> writes: > > > This patch is mostly a request for comments. The use case is to > > be able to configure an HTTP proxy for all subdomains of a

[PATCH v1 1/2] mailmap: add Patrick Steinhardt's work address

2017-01-23 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ea59205b9 100644 --- a/.mailmap +++ b/.mailmap @@ -177,6 +177,7 @@ Paolo Bonzini <bonz...@gnu.org> <paolo.bonz

[PATCH v1 2/2] urlmatch: allow regex-based URL matching

2017-01-23 Thread Patrick Steinhardt
. Signed-off-by: Patrick Steinhardt <patrick.steinha...@elego.de> --- Documentation/config.txt | 6 - t/t1300-repo-config.sh | 31 ++ urlmatch.c | 57 ++-- 3 files changed, 81 insertions(+), 13 deletions(-)

[PATCH v1 0/2] urlmatch: allow regexp-based matches

2017-01-23 Thread Patrick Steinhardt
the '?' prefix. Older clients will barf when trying to normalize the URL as '?' is not in the set of allowed characters for a URL, and for newer clients there will be no change in behavior for previously configured `http..*` keys. Regards Patrick Steinhardt Patrick Steinhardt (2): mailmap: add

[PATCH] doc: fix location of 'info/' with $GIT_COMMON_DIR

2016-11-11 Thread Patrick Steinhardt
at "$GIT_COMMON_DIR/index". Fix the typo to point to "$GIT_COMMON_DIR/info/" instead. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- Documentation/gitrepository-layout.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitrepository-l

Re: [ANNOUNCE] Git v2.11.0-rc0

2016-11-01 Thread Patrick Steinhardt
quot;, "git checkout" attempts to protect users from confusion >by refusing to check out a branch that is already checked out in >another worktree. However, this also prevented checking out a >branch, which is designated as the primary branch of a bare >r

Re: [PATCH] rebase -i: restore autostash on abort

2016-06-29 Thread Patrick Steinhardt
On Tue, Jun 28, 2016 at 02:13:49PM -0700, Junio C Hamano wrote: > Matthieu Moy writes: > > > It is "interesting" if you mean "matches real-life use-case", as it > > corresponds to the case where the user killed the editor (as reported by > > Daniel Hahler indeed,

[PATCH v2] rebase -i: restore autostash on abort

2016-06-29 Thread Patrick Steinhardt
the issue by trying to re-apply the autostash in `die_abort`. This will also handle the case where the autostash does not apply cleanly anymore by recording it in a user-visible stash. Reported-by: Daniel Hahler <g...@thequod.de> Signed-off-by: Patrick Steinhardt <p...@pks.im> --- The

[PATCH] rebase -i: restore autostash on abort

2016-06-28 Thread Patrick Steinhardt
the issue by trying to re-apply the autostash in `die_abort`. This will also handle the case where the autostash does not apply cleanly anymore by recording it in a user-visible stash. Reported-by: Daniel Hahler <g...@thequod.de> Signed-off-by: Patrick Steinhardt <p...@pks.im> ---

Re: git segfaults on older Solaris releases

2016-04-12 Thread Patrick Steinhardt
On Sat, Apr 09, 2016 at 01:39:05PM -0400, Jeff King wrote: > On Sat, Apr 09, 2016 at 09:02:38AM +0200, Tom G. Christensen wrote: > > > I've finished testing 2.8.1 and I found one more case where a null is being > > printed and causing a segfault. This happens even on Solaris 8 and 9. > > The

[PATCH v2] xdiff/xmerge: fix memory leak in xdl_merge

2016-02-23 Thread Patrick Steinhardt
leak by also releasing allocated memory related to the first file. Helped-by: Johannes Schindelin <johannes.schinde...@gmx.de> Signed-off-by: Patrick Steinhardt <p...@pks.im> --- xdiff/xmerge.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xdiff/xmer

Re: [PATCH] xdiff/xmerge: fix memory leak in xdl_merge

2016-02-23 Thread Patrick Steinhardt
On Tue, Feb 23, 2016 at 11:09:50AM +0100, Johannes Schindelin wrote: > Hi Patrick, > > On Tue, 23 Feb 2016, Patrick Steinhardt wrote: > > > When building the script for the second file that is to be merged > > we have already allocated memory for data structures relat

[PATCH] xdiff/xmerge: fix memory leak in xdl_merge

2016-02-23 Thread Patrick Steinhardt
leak by also releasing allocated memory related to the first file. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- xdiff/xmerge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c index d98f430..d04eb46 100644 --- a/xdiff/xmerge.c +++ b/xdiff/xm

[PATCH v6 02/15] branch: report errors in tracking branch setup

2016-02-22 Thread Patrick Steinhardt
the error message but continue the program as usual. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- branch.c | 50 -- branch.h | 3 ++- t/t3200-branch.sh | 9 - 3 files changed, 46 insertions(+), 16 deletions(-)

[PATCH v6 15/15] config: rename git_config_set_or_die to git_config_set

2016-02-22 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/branch.c| 6 +++--- builtin/clone.c | 8 builtin/init-db.c | 20 ++-- builtin/remote.c| 32 builtin/submodule--helper.c | 4 ++-- c

[PATCH v6 04/15] branch: die on config error when editing branch description

2016-02-22 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/branch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 0978287..c043cfc 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -570,7 +570,6 @@ static cons

[PATCH v6 03/15] branch: die on config error when unsetting upstream

2016-02-22 Thread Patrick Steinhardt
. Fix this by dying with an error message when we cannot unset the configuration. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/branch.c | 4 ++-- t/t3200-branch.sh | 7 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c

[PATCH v6 14/15] config: rename git_config_set to git_config_set_gently

2016-02-22 Thread Patrick Steinhardt
. As some code may rely on the actual return values for `git_config_set` we still require the ability to invoke these functions without aborting. Rename the existing `git_config_set` functions to `git_config_set_gently` to keep them available for those callers. Signed-off-by: Patrick Steinhardt &l

[PATCH v6 11/15] init-db: die on config errors when initializing empty repo

2016-02-22 Thread Patrick Steinhardt
are unable to write the configuration files to disk. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/init-db.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index 07229d6..ef19048 100644 --- a/builtin/ini

[PATCH v6 07/15] remote: die on config error when setting URL

2016-02-22 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/remote.c | 11 ++- t/t5505-remote.sh | 9 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 2b2ff9b..8b78c3d 100644 --- a/builtin/remote.c +++ b/builtin/re

[PATCH v6 13/15] compat: die when unable to set core.precomposeunicode

2016-02-22 Thread Patrick Steinhardt
When calling `git_config_set` to set 'core.precomposeunicode' we ignore the return value of the function, which may indicate that we were unable to write the value back to disk. As the function is only called by init-db we can and should die when an error occurs. Signed-off-by: Patrick Steinhardt

[PATCH v6 10/15] clone: die on config error in cmd_clone

2016-02-22 Thread Patrick Steinhardt
files to disk. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/clone.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index bcba080..164038a 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -786,12 +786,12 @@ stati

[PATCH v6 12/15] sequencer: die on config error when saving replay opts

2016-02-22 Thread Patrick Steinhardt
. As this may lead us to fail when trying to continue the sequence the error can be fatal. Fix this by dying immediately when we are unable to write back any replay option. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- sequencer.c | 22 +++--- 1 file changed, 11 inse

[PATCH v6 09/15] remote: die on config error when manipulating remotes

2016-02-22 Thread Patrick Steinhardt
When manipulating remotes we try to set various configuration values without checking if the values were persisted correctly, possibly leaving the remote in an inconsistent state. Fix this issue by dying early and notifying the user about the error. Signed-off-by: Patrick Steinhardt <p...@pks

[PATCH v6 06/15] submodule--helper: die on config error when cloning module

2016-02-22 Thread Patrick Steinhardt
. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/submodule--helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index f4c3eff..c7e1ea2 100644 --- a/builtin/submodule--helper.c +++ b/builtin/sub

[PATCH v6 08/15] remote: die on config error when setting/adding branches

2016-02-22 Thread Patrick Steinhardt
have been set without notifying the user. Fix this issue by dying early on configuration error. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/remote.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/builtin/remote.c b/builtin/re

[PATCH v6 01/15] config: introduce set_or_die wrappers

2016-02-22 Thread Patrick Steinhardt
. These wrappers are temporary only to ease the transition to let `git_config_set` die by default. They will be removed later on when `git_config_set` itself has been replaced by `git_config_set_gently`. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- cache.h | 4 config.

[PATCH v6 05/15] submodule: die on config error when linking modules

2016-02-22 Thread Patrick Steinhardt
to the user. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- submodule.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/submodule.c b/submodule.c index b83939c..589a82c 100644 --- a/submodule.c +++ b/submodule.c @@ -1087,11 +1087,9 @@ void connect_work_tree_and_g

[PATCH v6 00/15] config: make git_config_set die on failure

2016-02-22 Thread Patrick Steinhardt
composed_unicode ? "true" : "false"); + git_config_set("core.precomposeunicode", + precomposed_unicode ? "true" : "false"); git_path_buf(, "%s", auml_nfc); if (unlink

Re: [PATCH v5 00/15] config: make git_config_set die on failure

2016-02-17 Thread Patrick Steinhardt
On Tue, Feb 16, 2016 at 12:15:35PM -0500, Eric Sunshine wrote: > On Tue, Feb 16, 2016 at 7:56 AM, Patrick Steinhardt <p...@pks.im> wrote: > > [...] > > Junio pointed out that it might not always be the most sensible > > thing to die when install_branch_config fails. Af

Re: [PATCH v5 02/15] branch: report errors in tracking branch setup

2016-02-17 Thread Patrick Steinhardt
On Tue, Feb 16, 2016 at 03:07:55PM -0800, Junio C Hamano wrote: > Patrick Steinhardt <p...@pks.im> writes: > > > if (rebasing) { > > strbuf_reset(); > > strbuf_addf(, "branch.%s.rebase", local); >

Re: [PATCH v5 13/15] compat: die when unable to set core.precomposeunicode

2016-02-17 Thread Patrick Steinhardt
On Wed, Feb 17, 2016 at 10:14:57AM +0100, Lars Schneider wrote: > > On 16 Feb 2016, at 13:56, Patrick Steinhardt <p...@pks.im> wrote: > > > When calling `git_config_set` to set 'core.precomposeunicode' we > > ignore the return value of the function, which may indic

[PATCH v5 00/15] config: make git_config_set die on failure

2016-02-16 Thread Patrick Steinhardt
quot; * from remote "origin". Used by git branch --set-upstream. - * Dies if unable to install branch config. + * Returns 0 on success. */ #define BRANCH_CONFIG_VERBOSE 01 -extern void install_branch_config(int flag, const char *local, const char *origin, const char *remote); +extern int in

[PATCH v5 11/15] init-db: die on config errors when initializing empty repo

2016-02-16 Thread Patrick Steinhardt
are unable to write the configuration files to disk. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/init-db.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index 07229d6..ef19048 100644 --- a/builtin/ini

[PATCH v5 05/15] submodule: die on config error when linking modules

2016-02-16 Thread Patrick Steinhardt
to the user. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- submodule.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/submodule.c b/submodule.c index b83939c..589a82c 100644 --- a/submodule.c +++ b/submodule.c @@ -1087,11 +1087,9 @@ void connect_work_tree_and_g

[PATCH v5 02/15] branch: report errors in tracking branch setup

2016-02-16 Thread Patrick Steinhardt
the error message but continue the program as usual. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- branch.c | 45 +++-- branch.h | 3 ++- t/t3200-branch.sh | 9 - 3 files changed, 41 insertions(+), 16 deletions(-) diff

[PATCH v5 04/15] branch: die on config error when editing branch description

2016-02-16 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/branch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 0978287..c043cfc 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -570,7 +570,6 @@ static cons

[PATCH v5 12/15] sequencer: die on config error when saving replay opts

2016-02-16 Thread Patrick Steinhardt
. As this may lead us to fail when trying to continue the sequence the error can be fatal. Fix this by dying immediately when we are unable to write back any replay option. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- sequencer.c | 22 +++--- 1 file changed, 11 inse

[PATCH v5 06/15] submodule--helper: die on config error when cloning module

2016-02-16 Thread Patrick Steinhardt
. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/submodule--helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index f4c3eff..c7e1ea2 100644 --- a/builtin/submodule--helper.c +++ b/builtin/sub

[PATCH v5 10/15] clone: die on config error in cmd_clone

2016-02-16 Thread Patrick Steinhardt
files to disk. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/clone.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index bcba080..164038a 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -786,12 +786,12 @@ stati

[PATCH v5 07/15] remote: die on config error when setting URL

2016-02-16 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/remote.c | 11 ++- t/t5505-remote.sh | 9 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 2b2ff9b..8b78c3d 100644 --- a/builtin/remote.c +++ b/builtin/re

[PATCH v5 14/15] config: rename git_config_set to git_config_set_gently

2016-02-16 Thread Patrick Steinhardt
. As some code may rely on the actual return values for `git_config_set` we still require the ability to invoke these functions without aborting. Rename the existing `git_config_set` functions to `git_config_set_gently` to keep them available for those callers. Signed-off-by: Patrick Steinhardt &l

[PATCH v5 09/15] remote: die on config error when manipulating remotes

2016-02-16 Thread Patrick Steinhardt
When manipulating remotes we try to set various configuration values without checking if the values were persisted correctly, possibly leaving the remote in an inconsistent state. Fix this issue by dying early and notifying the user about the error. Signed-off-by: Patrick Steinhardt <p...@pks

[PATCH v5 01/15] config: introduce set_or_die wrappers

2016-02-16 Thread Patrick Steinhardt
. These wrappers are temporary only to ease the transition to let `git_config_set` die by default. They will be removed later on when `git_config_set` itself has been replaced by `git_config_set_gently`. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- cache.h | 4 config.

[PATCH v5 15/15] config: rename git_config_set_or_die to git_config_set

2016-02-16 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/branch.c| 6 +++--- builtin/clone.c | 8 builtin/init-db.c | 20 ++-- builtin/remote.c| 32 builtin/submodule--helper.c | 4 ++-- c

[PATCH v5 08/15] remote: die on config error when setting/adding branches

2016-02-16 Thread Patrick Steinhardt
have been set without notifying the user. Fix this issue by dying early on configuration error. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/remote.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/builtin/remote.c b/builtin/re

[PATCH v5 13/15] compat: die when unable to set core.precomposeunicode

2016-02-16 Thread Patrick Steinhardt
When calling `git_config_set` to set 'core.precomposeunicode' we ignore the return value of the function, which may indicate that we were unable to write the value back to disk. As the function is only called by init-db we can and should die when an error occurs. Signed-off-by: Patrick Steinhardt

[PATCH v5 03/15] branch: die on config error when unsetting upstream

2016-02-16 Thread Patrick Steinhardt
. Fix this by dying with an error message when we cannot unset the configuration. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/branch.c | 4 ++-- t/t3200-branch.sh | 7 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c

Re: [PATCH v4 06/15] submodule--helper: die on config error when cloning module

2016-02-08 Thread Patrick Steinhardt
On Tue, Feb 02, 2016 at 01:45:50PM -0500, Eric Sunshine wrote: > On Tue, Feb 2, 2016 at 6:51 AM, Patrick Steinhardt <p...@pks.im> wrote: > > When setting the 'core.worktree' option for a newly cloned > > submodule we ignore the return value of `git_config_set_in_file

Re: [PATCH v4 02/15] branch: die on error in setting up tracking branch

2016-02-08 Thread Patrick Steinhardt
On Mon, Feb 08, 2016 at 02:42:32PM +0100, Patrick Steinhardt wrote: > On Tue, Feb 02, 2016 at 12:49:26PM -0800, Junio C Hamano wrote: > > Patrick Steinhardt <p...@pks.im> writes: > > > > > The setup_tracking function calls install_branch_config, which > > >

Re: [PATCH v4 02/15] branch: die on error in setting up tracking branch

2016-02-08 Thread Patrick Steinhardt
On Tue, Feb 02, 2016 at 12:49:26PM -0800, Junio C Hamano wrote: > Patrick Steinhardt <p...@pks.im> writes: > > > The setup_tracking function calls install_branch_config, which > > may fail writing the configuration due to a locked configuration > > file or other er

Re: [PATCH v4 00/15] config: make git_config_set die on failure

2016-02-04 Thread Patrick Steinhardt
On Tue, Feb 02, 2016 at 12:58:42PM -0800, Junio C Hamano wrote: > Patrick Steinhardt <p...@pks.im> writes: > > > Patrick Steinhardt (15): > > config: introduce set_or_die wrappers > > branch: die on error in setting up tracking branch > > branch: die on

[PATCH v4 08/15] remote: die on config error when setting/adding branches

2016-02-02 Thread Patrick Steinhardt
have been set without notifying the user. Fix this issue by dying early on configuration error. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/remote.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/builtin/remote.c b/builtin/re

[PATCH v4 10/15] clone: die on config error in cmd_clone

2016-02-02 Thread Patrick Steinhardt
files to disk. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/clone.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 81e238f..f2a2f9a 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -786,12 +786,12 @@ stati

[PATCH v4 11/15] init-db: die on config errors when initializing empty repo

2016-02-02 Thread Patrick Steinhardt
are unable to write the configuration files to disk. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/init-db.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index 07229d6..ef19048 100644 --- a/builtin/ini

[PATCH v4 09/15] remote: die on config error when manipulating remotes

2016-02-02 Thread Patrick Steinhardt
When manipulating remotes we try to set various configuration values without checking if the values were persisted correctly, possibly leaving the remote in an inconsistent state. Fix this issue by dying early and notifying the user about the error. Signed-off-by: Patrick Steinhardt <p...@pks

[PATCH v4 14/15] config: rename git_config_set to git_config_set_gently

2016-02-02 Thread Patrick Steinhardt
. As some code may rely on the actual return values for `git_config_set` we still require the ability to invoke these functions without aborting. Rename the existing `git_config_set` functions to `git_config_set_gently` to keep them available for those callers. Signed-off-by: Patrick Steinhardt &l

[PATCH v4 15/15] config: rename git_config_set_or_die to git_config_set

2016-02-02 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt <p...@pks.im> --- branch.c| 6 +++--- builtin/branch.c| 6 +++--- builtin/clone.c | 8 builtin/init-db.c | 20 ++-- builtin/remote.c

[PATCH v4 13/15] compat: die when unable to set core.precomposeunicode

2016-02-02 Thread Patrick Steinhardt
When calling `git_config_set` to set 'core.precomposeunicode' we ignore the return value of the function, which may indicate that we were unable to write the value back to disk. As the function is only called by init-db we can and should die when an error occurs. Signed-off-by: Patrick Steinhardt

[PATCH v4 12/15] sequencer: die on config error when saving replay opts

2016-02-02 Thread Patrick Steinhardt
. As this may lead us to fail when trying to continue the sequence the error can be fatal. Fix this by dying immediately when we are unable to write back any replay option. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- sequencer.c | 22 +++--- 1 file changed, 11 inse

[PATCH v4 06/15] submodule--helper: die on config error when cloning module

2016-02-02 Thread Patrick Steinhardt
. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- builtin/submodule--helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index f4c3eff..c7e1ea2 100644 --- a/builtin/submodule--helper.c +++ b/builtin/sub

  1   2   >