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 > http.http://

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 a

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 through

[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

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_PREFI

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
y to 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 --- This is the second version of [1]. It fixes a bu

[PATCH] pathspec: always honor `PATHSPEC_PREFIX_ORIGIN` flag

2017-04-03 Thread Patrick Steinhardt
xes interactive add. Signed-off-by: Patrick Steinhardt --- 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 +++ b/path

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

2017-02-28 Thread Patrick Steinhardt
or 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 --- The obvious other route here would be to fix how the stylesheets handle quoting inside

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

2017-02-28 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- 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 +++ b/Documentation

[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 --- 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 +125,9 @@ static int prune(int ac, const

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 no

[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 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 making use of URLs, namely `http

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

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt 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 thing to do right now. In the

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

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt Signed-off-by: Patrick Steinhardt --- .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 Pascal Obry Pascal Obry Pat Notz +Patrick

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

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt 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 the host and/or port separately becomes

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

2017-01-31 Thread Patrick Steinhardt
From: Patrick Steinhardt 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 `urlmatch` is the configuration subsystem. It

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 writes: > > > Patrick Steinhardt writes: > > > >> - I realized that with my patches, "ranking" of URLs was broken. > >>Previously, we've always taken the lo

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

2017-01-27 Thread Patrick Steinhardt
m.proxy"; sets "http.proxy" 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 Helped-by: Junio

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

2017-01-27 Thread Patrick Steinhardt
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 --- urlmatch.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git

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

2017-01-27 Thread Patrick Steinhardt
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 --- t/t1300-repo

[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 --- urlmatch.c | 16 urlmatch.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/urlmatch.c b/urlmatch.c

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

2017-01-27 Thread Patrick Steinhardt
-rules are actually 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

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

2017-01-27 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- .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 Pascal Obry Pascal Obry Pat Notz +Patrick Steinhardt Paul

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 writes: > > > 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 c

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" > > a quick comment on the documentation part .. > > > The URL matching function computes for two URLs whether they match not. > > The match is performed by splitting u

[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 --- urlmatch.c | 16 urlmatch.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/urlmatch.c b/urlmatch.c

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

2017-01-25 Thread Patrick Steinhardt
example adding a configuration key `http.https://*.example.com.proxy` will match all subdomains of `https://example.com`. Signed-off-by: Patrick Steinhardt --- Documentation/config.txt | 5 - t/t1300-repo-config.sh | 36 urlmatch.c | 38

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

2017-01-25 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- .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 Pascal Obry Pascal Obry Pat Notz +Patrick Steinhardt Paul

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

2017-01-25 Thread Patrick Steinhardt
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 --- urlmatch.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git

[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

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

2017-01-24 Thread Patrick Steinhardt
lude an interdiff 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 globb

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

2017-01-24 Thread Patrick Steinhardt
example adding a configuration key `http.https://*.example.com.proxy` will match all subdomains of `https://example.com`. Signed-off-by: Patrick Steinhardt --- Documentation/config.txt | 5 - t/t1300-repo-config.sh | 36 urlmatch.c | 38

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

2017-01-24 Thread Patrick Steinhardt
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 --- urlmatch.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git

[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 --- urlmatch.c | 16 urlmatch.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/urlmatch.c b/urlmatch.c

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

2017-01-24 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- .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 Pascal Obry Pascal Obry Pat Notz +Patrick Steinhardt Paul

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 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 > > certain domain where there are hundreds

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

2017-01-23 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- .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 Pascal Obry Pascal Obry Pat Notz +Patrick Steinhardt Paul

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

2017-01-23 Thread Patrick Steinhardt
n exact matches. Signed-off-by: Patrick Steinhardt --- Documentation/config.txt | 6 - t/t1300-repo-config.sh | 31 ++ urlmatch.c | 57 ++-- 3 files changed, 81 insertions(+), 13 deletions(-) diff --git a/Documenta

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

2017-01-23 Thread Patrick Steinhardt
an be by having 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 Pat

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

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

Re: [ANNOUNCE] Git v2.11.0-rc0

2016-11-01 Thread Patrick Steinhardt
worktree", "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

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

2016-06-28 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, "Abort with ":cq", which will mak

[PATCH v2] 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 Signed-off-by: Patrick Steinhardt --- The original bug-report can be found at [1

[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 Signed-off-by: Patrick Steinhardt --- git-rebase--interactive.sh | 1 + t/t3420

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 faill

[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 Signed-off-by: Patrick Steinhardt --- xdiff/xmerge.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c index d98f430..f338ad6 100644 --- a

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 --- 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/xmerge.c @@ -654,6 +654,8

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

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

[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 --- builtin/branch.c| 6 +++--- builtin/clone.c | 8 builtin/init-db.c | 20 ++-- builtin/remote.c| 32 builtin/submodule--helper.c | 4 ++-- cache.h

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

2016-02-22 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- 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 const char edit_description

[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 --- 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 index 3f6c825

[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

[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 --- 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 @@ static void

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

2016-02-22 Thread Patrick Steinhardt
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 --- sequencer.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions

[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

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

2016-02-22 Thread Patrick Steinhardt
he program. Signed-off-by: Patrick Steinhardt --- 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/submodule--helper.c

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

2016-02-22 Thread Patrick Steinhardt
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

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

2016-02-22 Thread Patrick Steinhardt
unable to write the configuration files to disk. Signed-off-by: Patrick Steinhardt --- 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/init-db.c +++ b

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

2016-02-22 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt --- 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/remote.c @@ -1583,11 +1583,12

[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 --- builtin/remote.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 8b78c3d

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

2016-02-22 Thread Patrick Steinhardt
ure to the user. Signed-off-by: Patrick Steinhardt --- 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_git_dir(

[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 --- cache.h | 4 config.c | 27

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

2016-02-22 Thread Patrick Steinhardt
die("core.precomposeunicode", - precomposed_unicode ? "true" : "false"); + git_config_set("core.precomposeunicode", + precomposed_unicode ? "true" : "false"); git_path_buf(&path, "%s&

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 wrote: > > [...] > > Junio pointed out that it might not always be the most sensible > > thing to die when install_branch_config fails. After thinking >

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 writes: > > > if (rebasing) { > > strbuf_reset(&key); > > strbuf_addf(&key, "branch.%s.rebase", local); > > - git

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 wrote: > > > When calling `git_config_set` to set 'core.precomposeunicode' we > > ignore the return value of the function, which may indicate that

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

2016-02-16 Thread Patrick Steinhardt
local" as downstream to branch "remote" * 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 *l

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

2016-02-16 Thread Patrick Steinhardt
unable to write the configuration files to disk. Signed-off-by: Patrick Steinhardt --- 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/init-db.c +++ b

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

2016-02-16 Thread Patrick Steinhardt
ure to the user. Signed-off-by: Patrick Steinhardt --- 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_git_dir(

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

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

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

2016-02-16 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- 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 const char edit_description

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

2016-02-16 Thread Patrick Steinhardt
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 --- sequencer.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions

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

2016-02-16 Thread Patrick Steinhardt
he program. Signed-off-by: Patrick Steinhardt --- 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/submodule--helper.c

[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 --- 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 @@ static void

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

2016-02-16 Thread Patrick Steinhardt
-off-by: Patrick Steinhardt --- 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/remote.c @@ -1583,11 +1583,12

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

2016-02-16 Thread Patrick Steinhardt
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

[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

[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 --- cache.h | 4 config.c | 27

[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 --- builtin/branch.c| 6 +++--- builtin/clone.c | 8 builtin/init-db.c | 20 ++-- builtin/remote.c| 32 builtin/submodule--helper.c | 4 ++-- cache.h

[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 --- builtin/remote.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 8b78c3d

[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

[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 --- 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 index 3f6c825

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 wrote: > > When setting the 'core.worktree' option for a newly cloned > > submodule we ignore the return value of `git_config_set_in_file`. > > As

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 writes: > > > > > The setup_tracking function calls install_branch_config, which > > > may fail writing

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 writes: > > > The setup_tracking function calls install_branch_config, which > > may fail writing the configuration due to a locked configuration > > file or other error conditions. setu

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 writes: > > > Patrick Steinhardt (15): > > config: introduce set_or_die wrappers > > branch: die on error in setting up tracking branch > > branch: die on config error when u

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

2016-02-02 Thread Patrick Steinhardt
On Tue, Feb 02, 2016 at 12:51:48PM +0100, Patrick Steinhardt wrote: > When invoking `git-remote --set-url` we do not check the return > value when writing the actual new URL to the configuration file, > pretending to the user that the configuration has been set while > it was in fact n

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

2016-02-02 Thread Patrick Steinhardt
unable to write the configuration files to disk. Signed-off-by: Patrick Steinhardt --- 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/init-db.c +++ b

[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

[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 --- builtin/remote.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 8b78c3d

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

2016-02-02 Thread Patrick Steinhardt
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

[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 --- branch.c| 6 +++--- builtin/branch.c| 6 +++--- builtin/clone.c | 8 builtin/init-db.c | 20 ++-- builtin/remote.c| 32 builtin/submodule

[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

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

2016-02-02 Thread Patrick Steinhardt
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 --- sequencer.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions

[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 --- 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 @@ static void

  1   2   >