Re: [PATCH 1/3] githooks.txt: Improve the intro section

2016-04-24 Thread Eric Sunshine
On Sun, Apr 24, 2016 at 4:20 PM, Ævar Arnfjörð Bjarmason wrote: > Change the documentation so that: > [...] > Signed-off-by: Ævar Arnfjörð Bjarmason > --- > diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt > @@ -130,7 +130,11 @@ The

Re: [PATCH v3 2/3] travis-ci: express Linux/OS X dependency versions more clearly

2016-04-24 Thread Eric Sunshine
On Sunday, April 24, 2016, wrote: > The Git Travis CI OSX build always installs the latest versions of Git LFS and > Perforce via brew and the Linux build installs fixed versions. Consequently > new > LFS/Perforce versions can brake the OS X build even if there is no

Re: [PATCH] convert.c: fix some sparse warnings

2016-04-24 Thread Torsten Bögershausen
On 04/24/2016 07:14 PM, Ramsay Jones wrote: Sparse complains thus: SP convert.c convert.c:178:24: warning: Using plain integer as NULL pointer convert.c:239:28: warning: dubious: !x & y Signed-off-by: Ramsay Jones --- Hi Torsten, When you next

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Duy Nguyen
On Mon, Apr 25, 2016 at 12:42 AM, Ramsay Jones wrote: > > > On 24/04/16 17:56, Christian Couder wrote: >> On Sun, Apr 24, 2016 at 6:27 PM, Christian Couder >> wrote: >>> On Sun, Apr 24, 2016 at 5:23 PM, Ramsay Jones >>>

Re: [git send-email] Less secure?

2016-04-24 Thread Eric Wong
Neven Sajko wrote: > Gmail by default doesn't allow usage through send-email. > They say that send-email is "less secure" and that enabling it > makes it easier to break into my account. > > Is send-email really less secure than the Gmail web browser > interface? Like any

[PATCH v2 2/3] githooks.txt: Amend dangerous advice about 'update' hook ACL

2016-04-24 Thread Ævar Arnfjörð Bjarmason
Any ACL you implement via an 'update' hook isn't actual access control if the user has login access to the machine running git, because they can trivially just built their own git version which doesn't run the hook. Change the documentation to take this dangerous edge case into account, and

[PATCH v2] hooks: Add ability to specify where the hook directory is

2016-04-24 Thread Ævar Arnfjörð Bjarmason
Change the hardcoded lookup for .git/hooks/* to optionally lookup in $(git config core.hooksPath)/* instead. This is essentially a more intrusive version of the git-init ability to specify hooks on init time via init templates. The difference between that facility and this feature is that this

[git send-email] Less secure?

2016-04-24 Thread Neven Sajko
Gmail by default doesn't allow usage through send-email. They say that send-email is "less secure" and that enabling it makes it easier to break into my account. Is send-email really less secure than the Gmail web browser interface? Neven -- To unsubscribe from this list: send the line

Re: [PATCH v2] fast-import: implement unpack limit

2016-04-24 Thread Eric Wong
Junio C Hamano wrote: > Eric Wong writes: > > + argv_array_push(, "unpack-objects"); > > + argv_array_push(, "-q"); > > + > > + return run_command(); > Looks good. I haven't thought if "-q" is appropriate or not though. Oops, I think tying it

Re: [PATCH 2/3] githooks.txt: Amend dangerous advice about 'update' hook ACL

2016-04-24 Thread Jacob Keller
On Sun, Apr 24, 2016 at 1:20 PM, Ævar Arnfjörð Bjarmason wrote: > Any ACL you implement via an 'update' hook isn't actual access control > if the user has login access to the machine running git, because they > can trivially just built their own git version which doesn't run the

[PATCH 3/3] githooks.txt: Minor improvements to the grammar & phrasing

2016-04-24 Thread Ævar Arnfjörð Bjarmason
Change: * Sentences that needed "the" or "a" to either add those or change them so they don't need them. * The little tangent about "You can use this to do X (if your project wants to do X)" can just be shortened to "e.g. if you want to do X". * s/parameter/parameters/ when the plural

[PATCH 2/3] githooks.txt: Amend dangerous advice about 'update' hook ACL

2016-04-24 Thread Ævar Arnfjörð Bjarmason
Any ACL you implement via an 'update' hook isn't actual access control if the user has login access to the machine running git, because they can trivially just built their own git version which doesn't run the hook. Change the documentation to take this dangerous edge case into account, and

[PATCH 1/3] githooks.txt: Improve the intro section

2016-04-24 Thread Ævar Arnfjörð Bjarmason
Change the documentation so that: * We don't talk about "little scripts". Hooks can be as big as you want, and don't have to be scripts, just call them "programs". * We note what happens with chdir() before a hook is called, nothing documented this explicitly, but the current behavior is

Re: git-scm.org bug: Broken link in git-push documentation

2016-04-24 Thread Ævar Arnfjörð Bjarmason
On Sun, Apr 24, 2016 at 9:58 PM, Matthieu Moy wrote: > Ęvar Arnfjörš Bjarmason writes: > >> I couldn't find a way to report git-scm.org-specific bugs > > You can do so here: > > https://github.com/git/git-scm.com/issues Thanks. I didn't find that,

Re: git-scm.org bug: Broken link in git-push documentation

2016-04-24 Thread Matthieu Moy
Ævar Arnfjörð Bjarmason writes: > I couldn't find a way to report git-scm.org-specific bugs You can do so here: https://github.com/git/git-scm.com/issues -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in

Re: [PATCH v2 03/21] t/test-lib-functions.sh: generalize test_cmp_rev

2016-04-24 Thread Stephan Beyer
Hi, On 04/15/2016 10:00 PM, Junio C Hamano wrote: > Stephan Beyer writes: > >> test_cmp_rev() took exactly two parameters, the expected revision >> and the revision to test. This commit generalizes this function >> such that it takes any number of at least two revisions: the >>

Re: Awkward and confusing question in git --send-email

2016-04-24 Thread Junio C Hamano
John Darrington writes: > Git --send-email poses the question: > > "Who should the emails be sent to (if any)?" > > Apart from sounding clumsy (not to mention incorrect grammar), it took me a > while to work out what this meant. > > I suggest this be changed to :

git-scm.org bug: Broken link in git-push documentation

2016-04-24 Thread Ævar Arnfjörð Bjarmason
I couldn't find a way to report git-scm.org-specific bugs, but I guess whoever maintains it these days also reads the list. Here: https://git-scm.com/docs/git-push#OPTIONS If you click on the "GIT URLS" link it's broken. If you search for "urls.txt" in the document you can see that this is

Re: [PATCH v2] fast-import: implement unpack limit

2016-04-24 Thread Junio C Hamano
Eric Wong writes: > +static int loosen_small_pack(const struct packed_git *p) > +{ > + struct child_process unpack = CHILD_PROCESS_INIT; > + > + if (lseek(p->pack_fd, 0, SEEK_SET) < 0) > + die_errno("Failed seeking to start of '%s'", p->pack_name); > +

Re: [PATCH v3 3/3] git-p4: fix Git LFS pointer parsing

2016-04-24 Thread Sebastian Schuberth
On Sun, Apr 24, 2016 at 8:58 PM, wrote: > --- a/git-p4.py > +++ b/git-p4.py > @@ -1064,8 +1064,15 @@ class GitLFS(LargeFileSystem): > if pointerProcess.wait(): > os.remove(contentFile) > die('git-lfs pointer command failed. Did you

Re: [git-multimail] smtplib, check certificate

2016-04-24 Thread Simon Pontié
Le 22/04/2016 08:41, Michael Haggerty a écrit : > I hate that we even have to worry about this stuff, but > graingert/secure-smtplib looks to be GPLv3, whereas git-multimail is > GPLv2 (like the Git project and Linux); *not* "GPLv2 or later". So if > "inspired" means "incorporated copyrightable

Re: make test Unexpected passes

2016-04-24 Thread Junio C Hamano
Ben Woosley writes: > These know breakages: > > ok 50 - rebase -m --onto --root > ok 54 - rebase -m without --onto --root with disjoint history > > Have to do with rebasing a root/orphan branch with the -m flag, > which defaults to -- merge=recursive, which is the case the

[PATCH v3 3/3] git-p4: fix Git LFS pointer parsing

2016-04-24 Thread larsxschneider
From: Lars Schneider Git LFS 1.2.0 removed a preamble from the output of the 'git lfs pointer' command [1] which broke the parsing of this output. Adjust the parser to support the old and the new format. Please note that this patch slightly changes the second return

[PATCH v3 0/3] git-p4: fix Git LFS pointer parsing

2016-04-24 Thread larsxschneider
From: Lars Schneider v1: $gmane/291917 v2: $gmane/291991 diff to v2: * use regex to parse "oid" instead of a complicated split logic ($gmane/291995, thanks Sebastian) * add a note to the commit message emphasizing the change from array to string in the second

[PATCH v3 1/3] travis-ci: update Git-LFS and P4 to the latest version

2016-04-24 Thread larsxschneider
From: Lars Schneider Signed-off-by: Lars Schneider --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78e433b..4acf617 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8

[PATCH v3 2/3] travis-ci: express Linux/OS X dependency versions more clearly

2016-04-24 Thread larsxschneider
From: Lars Schneider The Git Travis CI OSX build always installs the latest versions of Git LFS and Perforce via brew and the Linux build installs fixed versions. Consequently new LFS/Perforce versions can brake the OS X build even if there is no change in Git.

Re: [git-multimail] smtplib, check certificate

2016-04-24 Thread Simon Pontié
Le 22/04/2016 08:05, Matthieu Moy a écrit : > Hi, and thanks for the patch. Hi. Thanks for your tool, it is very useful! > Please, add your sign-off and a proper commit message to your patch, > see: Done, I also signed my commit via PGP. > I'm OK with patches by email, but you may prefer

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Ramsay Jones
On 24/04/16 17:56, Christian Couder wrote: > On Sun, Apr 24, 2016 at 6:27 PM, Christian Couder > wrote: >> On Sun, Apr 24, 2016 at 5:23 PM, Ramsay Jones >> wrote: >>> >>> >>> On 24/04/16 14:33, Christian Couder wrote: This is a

[PATCH] convert.c: fix some sparse warnings

2016-04-24 Thread Ramsay Jones
Sparse complains thus: SP convert.c convert.c:178:24: warning: Using plain integer as NULL pointer convert.c:239:28: warning: dubious: !x & y Signed-off-by: Ramsay Jones --- Hi Torsten, When you next re-roll your 'tb/convert-eol-autocrlf' branch, could

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Christian Couder
On Sun, Apr 24, 2016 at 6:27 PM, Christian Couder wrote: > On Sun, Apr 24, 2016 at 5:23 PM, Ramsay Jones > wrote: >> >> >> On 24/04/16 14:33, Christian Couder wrote: >>> This is a patch series about libifying `git apply` functionality, and

Re: [PATCH] t9824: fix broken &&-chain in a subshell

2016-04-24 Thread Lars Schneider
On 24 Apr 2016, at 18:37, SZEDER Gábor wrote: > > Quoting Lars Schneider : > >> On 24 Apr 2016, at 13:50, SZEDER Gábor wrote: >> >>> Signed-off-by: SZEDER Gábor >>> --- >>> >>> As far as I can tell after

Re: [PATCH] t9824: fix broken &&-chain in a subshell

2016-04-24 Thread SZEDER Gábor
Quoting Lars Schneider : On 24 Apr 2016, at 13:50, SZEDER Gábor wrote: Signed-off-by: SZEDER Gábor --- As far as I can tell after eyeballing the test script, this was the only case where the &&-chain was broken.

Re: [PATCH] t9824: fix broken &&-chain in a subshell

2016-04-24 Thread Lars Schneider
On 24 Apr 2016, at 13:50, SZEDER Gábor wrote: > Signed-off-by: SZEDER Gábor > --- > > As far as I can tell after eyeballing the test script, this was the > only case where the &&-chain was broken. > > t/t9824-git-p4-git-lfs.sh | 2 +- > 1 file changed, 1

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Christian Couder
On Sun, Apr 24, 2016 at 5:23 PM, Ramsay Jones wrote: > > > On 24/04/16 14:33, Christian Couder wrote: >> This is a patch series about libifying `git apply` functionality, and >> using this libified functionality in `git am`, so that no 'git apply' >> process is spawn

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Ramsay Jones
On 24/04/16 14:33, Christian Couder wrote: > This is a patch series about libifying `git apply` functionality, and > using this libified functionality in `git am`, so that no 'git apply' > process is spawn anymore. This makes `git am` significantly faster, so > `git rebase`, when it uses the am

[PATCH v6b 09/10] t6038; use crlf on all platforms

2016-04-24 Thread tboegi
From: Torsten Bögershausen t6038 uses different code, dependig if NATIVE_CRLF is set ot not. When the native line endings are LF, merge.renormalize is not tested very well. Change the test to always use CRLF by setting core.eol=crlf. After doing so, the test fails: rm

[PATCH v6b 04/10] convert.c: ident + core.autocrlf didn't work

2016-04-24 Thread tboegi
From: Torsten Bögershausen When the ident attributes is set, get_stream_filter() did not obey core.autocrlf=true, and the file was checked out with LF. Change the rule when a streaming filter can be used: - if an external filter is specified, don't use a stream filter. - if the

[PATCH v6b 08/10] convert.c: more safer crlf handling with text attribute

2016-04-24 Thread tboegi
From: Torsten Bögershausen This patch extends the work done in commit c480539: "Make it work also for un-normalized repositories". Make sure that CRLF can be converted round trip, or don't convert them at all. The old handling would treat a file as unchanged after checkout, as

[PATCH v6b 10/10] ce_compare_data() did not respect conversion

2016-04-24 Thread tboegi
From: Torsten Bögershausen We define the working tree file is clean if either: * the result of running convert_to_git() on the working tree contents matches what is in the index (because that would mean doing another "git add" on the path is a no-op); OR * the result

[PATCH v6b 07/10] convert: unify the "auto" handling of CRLF

2016-04-24 Thread tboegi
From: Torsten Bögershausen Before this change, $ echo "* text=auto" >.gitattributes $ echo "* eol=crlf" >>.gitattributes would have the same effect as $ echo "* text" >.gitattributes $ git config core.eol crlf Since the 'eol' attribute had higher priority than 'text=auto', this

[PATCH v6b 06/10] convert.c: stream and early out

2016-04-24 Thread tboegi
From: Torsten Bögershausen When statistics are done for the autocrlf handling, the search in the content can be stopped, if e.g - a search for binary is done, and a NUL character is found - a search for CRLF is done, and the first CRLF is found. Similar when statistics for binary

[PATCH v6b 05/10] read-cache: factor out get_sha1_from_index() helper

2016-04-24 Thread tboegi
From: Torsten Bögershausen Factor out the retrieval of the sha1 for a given path in read_blob_data_from_index() into the function get_sha1_from_index(). This will be used in the next commit, when convert.c can do the analyze for "text=auto" without slurping the whole blob into

[PATCH v6b 03/10] t0027: test cases for combined attributes

2016-04-24 Thread tboegi
From: Torsten Bögershausen Add more test cases for the not normalized files ("NNO"). The "text" attribute is most important, use it as the first parameter. "ident", if set, is the second paramater followed by the eol attribute. The eol attribute overrides core.autocrlf, which

[PATCH v6b 02/10] convert: allow core.autocrlf=input and core.eol=crlf

2016-04-24 Thread tboegi
From: Torsten Bögershausen Even though the configuration parser errors out when core.autocrlf is set to 'input' when core.eol is set to 'crlf', there is no need to do so, because the core.autocrlf setting trumps core.eol. Allow all combinations of core.crlf and core.eol and

[PATCH v6b 01/10] t0027: Make commit_chk_wrnNNO() reliable

2016-04-24 Thread tboegi
From: Torsten Bögershausen When the content of a commited file is unchanged and the attributes are changed, Git may not detect that the next commit must treat the file as changed. This happens when lstat() doesn't detect a change, since neither inode, mtime nor size are changed.

[PATCH 82/83] environment: add set_index_file()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- cache.h | 1 + environment.c | 5 + 2 files changed, 6 insertions(+) diff --git a/cache.h b/cache.h index 2711048..7f36aa3 100644 --- a/cache.h +++ b/cache.h @@ -461,6 +461,7 @@ extern int is_inside_work_tree(void); extern

[PATCH 80/83] run-command: make dup_devnull() non static

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- run-command.c | 2 +- run-command.h | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/run-command.c b/run-command.c index 8c7115a..29d2bda 100644 --- a/run-command.c +++ b/run-command.c @@ -85,7 +85,7 @@ static

[PATCH 26/83] builtin/apply: move 'apply' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b6d2343..699cabf 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -25,6

[PATCH 15/83] builtin/apply: move 'allow_overlap' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b57be2c..a5dff99 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -25,6 +25,7 @@ struct

[PATCH 16/83] builtin/apply: move 'cached' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index a5dff99..ba828df 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

[PATCH 04/83] builtin/apply: avoid local variable shadowing 'len' parameter

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 7115dc2..78849e4 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -2194,17 +2194,17

[PATCH 14/83] builtin/apply: move 'update_index' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 46 +++--- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 154679e..b57be2c 100644 --- a/builtin/apply.c +++

[PATCH 05/83] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

2016-04-24 Thread Christian Couder
The match_fragment() function is very big and contains a big special case algorithm that does line by line fuzzy matching. So let's extract this algorithm in a separate line_by_line_fuzzy_match() function. Signed-off-by: Christian Couder --- builtin/apply.c | 129

[PATCH 18/83] builtin/apply: move 'numstat' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index d90948a..16d78f9 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -36,6 +36,9 @@ struct

[PATCH 11/83] builtin/apply: move 'apply_in_reverse' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 51 --- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 3f8671c..755e0e3 100644 --- a/builtin/apply.c +++

[PATCH 79/83] apply: make some parsing functions static again

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- apply.c | 6 +++--- apply.h | 5 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apply.c b/apply.c index 99b7a2d..86e0d20 100644 --- a/apply.c +++ b/apply.c @@ -27,7 +27,7 @@ static void git_apply_config(void)

[PATCH 81/83] apply: roll back index in case of error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- apply.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/apply.c b/apply.c index 86e0d20..7cee834 100644 --- a/apply.c +++ b/apply.c @@ -4718,8 +4718,11 @@ int apply_all_patches(struct

[PATCH 30/83] builtin/apply: move 'has_include' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index c8b9bf0..0717cd2 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -70,6 +70,7 @@ struct apply_state

[PATCH 07/83] builtin/apply: introduce 'struct apply_state' to start libifying

2016-04-24 Thread Christian Couder
Currently commands that want to use the apply functionality have to launch a "git apply" process which can be bad for performance. Let's start libifying the apply functionality and to do that we first need to get rid of the global variables in "builtin/apply.c". This patch introduces "struct

[PATCH 22/83] builtin/apply: move 'unsafe_paths' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 506357c..c45e481 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -57,6 +57,8 @@ struct

[PATCH 83/83] builtin/am: use apply api in run_apply()

2016-04-24 Thread Christian Couder
This replaces run_apply() implementation with a new one that uses the apply api that has been previously prepared in apply.c and apply.h. This shoud improve performance a lot in certain cases. As the previous implementation was creating a new `git apply` process to apply each patch, it could be

[PATCH 20/83] builtin/apply: move 'threeway' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index e488879..33a1f8f 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -41,6 +41,8 @@ struct

[PATCH 09/83] builtin/apply: move 'check' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ad81210..6c628f6 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -25,12 +25,15 @@ struct

[PATCH 29/83] builtin/apply: move 'limit_by_name' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ab311c1..c8b9bf0 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -68,6 +68,8 @@

[PATCH 27/83] builtin/apply: move 'read_stdin' global into cmd_apply()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/apply.c b/builtin/apply.c index 699cabf..be237d1 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -96,7 +96,6 @@ static enum ws_ignore {

[PATCH 74/83] builtin/apply: make try_create_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 49ef4c9..32c38f0 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

[PATCH 40/83] builtin/apply: move 'ws_ignore_action' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 7d91454..fa07b33 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

[PATCH 42/83] builtin/apply: move 'linenr' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 75 ++--- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index bb58174..f387340 100644 --- a/builtin/apply.c +++

[PATCH 56/83] apply: move 'struct apply_state' to apply.h

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- apply.h | 124 builtin/apply.c | 121 +- 2 files changed, 125 insertions(+), 120 deletions(-) create mode 100644

[PATCH 75/83] builtin/apply: make create_one_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 32c38f0..5bd5154 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

[PATCH 63/83] builtin/apply: make apply_all_patches() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index eab5ae1..73247c7 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4551,7

[PATCH 48/83] builtin/apply: rename 'prefix_' parameter to 'prefix'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 787426f..6c0b153 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4670,10 +4670,10 @@ static int

[PATCH 35/83] builtin/apply: move 'whitespace_option' into 'struct apply_state'

2016-04-24 Thread Christian Couder
This will enable further refactoring. Signed-off-by: Christian Couder --- builtin/apply.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 9c4f67f..64bc3e9 100644 --- a/builtin/apply.c +++

[PATCH 55/83] builtin/apply: make parse_single_patch() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c| 17 + t/t4012-diff-binary.sh | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index e1d6c8b..de5c745 100644 --- a/builtin/apply.c +++

[PATCH 66/83] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 268356b..8b7a8e0 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -3699,7 +3699,7 @@ static

[PATCH 34/83] builtin/apply: move 'whitespace_error' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 209a1b4..9c4f67f 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -75,6

[PATCH 41/83] builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 49 + 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index fa07b33..bb58174 100644 --- a/builtin/apply.c +++

[PATCH 31/83] builtin/apply: move 'p_value' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 151 +--- 1 file changed, 99 insertions(+), 52 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 0717cd2..979849c 100644 --- a/builtin/apply.c +++

[PATCH 73/83] builtin/apply: make write_out_results() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index dae89e2..49ef4c9 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4367,6 +4367,12

[PATCH 57/83] builtin/apply: libify parse_whitespace_option()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 1c1ac7d..8d96f70 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -27,34 +27,34

[PATCH 71/83] builtin/apply: make create_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index e021fad..ebac9ee 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4253,7

[PATCH 65/83] builtin/apply: make gitdiff_verify_name() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 52 ++-- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 6b8ba2a..268356b 100644 --- a/builtin/apply.c +++

[PATCH 38/83] builtin/apply: move 'applied_after_fixing_ws' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 259f256..52602af 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -79,6 +79,7 @@ struct

[PATCH 45/83] builtin/apply: move 'state' init into init_apply_state()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 8508607..f2dffa9 100644 --- a/builtin/apply.c +++ b/builtin/apply.c

[PATCH 54/83] builtin/apply: make parse_chunk() return a negative integer on error

2016-04-24 Thread Christian Couder
This negative number can be -2 if no patch header has been found, otherwise it is -1. As parse_chunk() is called only by apply_patch() which already returns -1 when an error happened, let's make it return -1 when parse_chunk() returns -1. Signed-off-by: Christian Couder

[PATCH 44/83] builtin/apply: move 'symlink_changes' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 50 -- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b4c2bd8..8508607 100644 --- a/builtin/apply.c +++

[PATCH 43/83] builtin/apply: move 'fn_table' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index f387340..b4c2bd8 100644 --- a/builtin/apply.c +++

[PATCH 69/83] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 89118c1..5a5be49 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4210,7 +4210,7 @@

[PATCH 51/83] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-04-24 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. As a first step in this direction, let's make apply_patch() return -1 in case of errors instead of dying. For now its only caller apply_all_patches() will exit(1) when apply_patch() return -1. In a

[PATCH 76/83] builtin/apply: rename option parsing functions

2016-04-24 Thread Christian Couder
As these functions are going to be part of the libified apply api, let's give them a name that is more specific to the apply api. Signed-off-by: Christian Couder --- builtin/apply.c | 40 1 file changed, 20 insertions(+), 20

[PATCH 52/83] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index bc209f5..c0bb24c 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -454,10 +454,10 @@ static void

[PATCH 50/83] builtin/apply: get rid of the 'newfd' global

2016-04-24 Thread Christian Couder
The 'newfd' global is useless now as we can just test for "lock_file == NULL" instead of "newfd < 0". Signed-off-by: Christian Couder --- builtin/apply.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index

[PATCH 70/83] builtin/apply: make add_index_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 5a5be49..e021fad 100644 --- a/builtin/apply.c +++

[PATCH 64/83] builtin/apply: make parse_traditional_patch() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 73247c7..6b8ba2a 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -755,10 +755,10 @@

[PATCH 68/83] builtin/apply: make remove_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 69bb94c..89118c1 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4071,17 +4071,18 @@

[PATCH 53/83] builtin/apply: make find_header() return -1 instead of die()ing

2016-04-24 Thread Christian Couder
To be compatible with the rest of the error handling in builtin/apply.c, find_header() should return -1 instead of calling die(). Unfortunately find_header() already returns -1 when no header is found, so let's make it return -2 instead in this case. Signed-off-by: Christian Couder

[PATCH 58/83] builtin/apply: libify parse_ignorewhitespace_option()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 8d96f70..2f89922 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -57,20 +57,20 @@ static

[PATCH 47/83] builtin/apply: move applying patches into apply_all_patches()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 128 ++-- 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 94bf120..787426f 100644 --- a/builtin/apply.c +++

[PATCH 49/83] builtin/apply: move 'lock_file' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c keeps a linked list of all created lock_file structures. So let's make the 'lock_file' variable a pointer to a 'struct lock_file' and let's alloc the struct when needed. Signed-off-by: Christian Couder

[PATCH 72/83] builtin/apply: make write_out_one_result() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/apply.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ebac9ee..dae89e2 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

  1   2   >