To libify `git apply` functionality we have to signal errors to the
caller instead of exit()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", create_file() should just return what
add_conflicted_stages_file() and add_index_file() are
To libify `git apply` functionality we must make init_apply_state()
usable outside "builtin/apply.c".
Let's do that by moving it into a new "apply.c".
Helped-by: Eric Sunshine
Signed-off-by: Christian Couder
---
Makefile|
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", try_create_file() should return -1 in case of
error.
Unfortunately try_create_file() currently ret
To avoid possible mistakes and to uniformly show the errno
related messages, let's use error_errno() where possible.
Signed-off-by: Christian Couder
---
apply.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/apply.c b/apply.c
index a4dfc64..41a33d3 100644
--
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in builtin/apply.c, parse_whitespace_option() should return -1 instead
of calling die().
Signed-off-by: Christian Couder
Parsing `git apply` options can be useful to other commands that
want to call the libified apply functionality, because this way
they can easily pass some options from their own command line to
the libified apply functionality.
This will be used by `git am` in a following patch.
To make this
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 deletions(-)
diff --
Some parsing functions that were used in both "apply.c" and
"builtin/apply.c" are now only used in the former, so they
can be made static to "apply.c".
Signed-off-by: Christian Couder
---
apply.c | 6 +++---
apply.h | 5 -
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/apply.
To libify `git apply` functionality we have to signal errors to the
caller instead of exit()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", write_out_one_result() should just return what
remove_file() and create_file() are returning
pply_state(struct apply_state *state,
extern void clear_apply_state(struct apply_state *state);
extern int check_apply_state(struct apply_state *state, int force_apply);
+/*
+ * Some aspects of the apply behavior are controlled by the following
+ * bits in the "options" parameter passed to
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing or exit()ing.
To do that in a compatible manner with the rest of the error handling
in builtin/apply.c, parse_chunk() should return a negative integer
instead of calling die() or exit().
As parse_chunk
To libify `git apply` functionality we have to signal errors to the
caller instead of exit()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", create_one_file() should return -1 instead of
calling exit().
Signed-off-by: Christian Couder
--
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in builtin/apply.c, let's make find_header() return -128 instead of
calling die().
We could make it return -1, unfortun
The gitdiff_*() functions that are called as p->fn() in parse_git_header()
should return 1 instead of -1 in case of end of header or unrecognized
input, as these are not real errors. It just instructs the parser to break
out.
This makes it possible for gitdiff_*() functions to return -1 in case of
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", parse_ignorewhitespace_option() should return
-1 instead of calling die().
Signed-off-by: Christ
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", check_apply_state() should return -1 instead of
calling die().
Signed-off-by: Christian Couder
--
To libify `git apply` functionality we have to signal errors to the
caller instead of exit()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", init_apply_state() should return -1 instead of
calling exit().
Signed-off-by: Christ
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", gitdiff_*() functions should return -1 instead
of calling die().
A previous patch made it po
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", build_fake_ancestor() should return -1 instead
of calling die().
Helped-by: Eric Sunshine
Sig
To libify `git apply` functionality we must make check_apply_state()
usable outside "builtin/apply.c".
Let's do that by moving it into "apply.c".
Signed-off-by: Christian Couder
---
apply.c | 32
apply.h |
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", remove_file() should return -1 instead of
calling die().
Signed-off-by: Christian Couder
--
To finish libifying the apply functionality, apply_all_patches() should not
die() or exit() in case of error, but return either 128 or 1, so that it
gives the same exit code as when die() or exit(1) is called. This way
scripts relying on the exit code don't need to be changed.
While doing th
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", parse_traditional_patch() should return -1
instead of calling die().
Signed-off-by: Christ
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing. Let's do that by returning -1 instead of
die()ing in read_patch_file().
Helped-by: Stefan Beller
Signed-off-by: Christian Couder
---
builtin/apply.c | 8 +---
1 file changed, 5 insertions(
To libify `git apply` functionality we must make 'struct apply_state'
usable outside "builtin/apply.c".
Let's do that by creating a new "apply.h" and moving
'struct apply_state' there.
Signed-off-by:
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 or -128 in case of errors instead of dying. For now its only
caller apply_all_patches() will exit(128) when apply_patch()
r
Goal
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 backend, is also significan
To prepare for some structs and constants being moved from
builtin/apply.c to apply.h, we should give them some more
specific names to avoid possible name collisions in the global
namespace.
Signed-off-by: Christian Couder
---
builtin/apply.c | 20 ++--
1 file changed, 10 inserti
On Thu, Sep 1, 2016 at 7:48 PM, Junio C Hamano wrote:
> Christian Couder writes:
>
>> Following Stefan's review, it looks like I will need to resend at
>> least 02/14, 10/14 and 14/14.
>> What do you prefer me to resend:
>> 1) all the last 40 or so patches
>> 2) the last 14 patches
>> 3) only the
On Sun, Sep 4, 2016 at 6:31 PM, Ramsay Jones
wrote:
>
>
> On 04/09/16 11:54, Christian Couder wrote:
>> On Thu, Sep 1, 2016 at 10:19 AM, Christian Couder
>> wrote:
>>> On Thu, Sep 1, 2016 at 12:20 AM, Stefan Beller wrote:
>
> +static void mute_routine(const char *bla, va_list params)
>>>
On 04/09/16 11:54, Christian Couder wrote:
> On Thu, Sep 1, 2016 at 10:19 AM, Christian Couder
> wrote:
>> On Thu, Sep 1, 2016 at 12:20 AM, Stefan Beller wrote:
>>> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
>>> wrote:
To avoid printing anything when applying with
`state->app
On Thu, Sep 1, 2016 at 10:19 AM, Christian Couder
wrote:
> On Thu, Sep 1, 2016 at 12:20 AM, Stefan Beller wrote:
>> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
>> wrote:
>>> To avoid printing anything when applying with
>>> `state->apply_verbosity == verbosity_silent`, let's save the
>>>
On Thu, Sep 1, 2016 at 1:01 AM, Christian Couder
wrote:
> On Thu, Sep 1, 2016 at 12:07 AM, Stefan Beller wrote:
>>> Printing on stdout, and calls to warning() or error() are not
>>> taken care of in this patch, as that will be done in following
>>> patches.
>>
>>> - if (state->apply
Christian Couder writes:
> Following Stefan's review, it looks like I will need to resend at
> least 02/14, 10/14 and 14/14.
> What do you prefer me to resend:
> 1) all the last 40 or so patches
> 2) the last 14 patches
> 3) only the few patches that changed
If this reroll is to be the candidate
On Thu, Sep 1, 2016 at 12:15 AM, Junio C Hamano wrote:
> Christian Couder writes:
>
>> On Mon, Aug 29, 2016 at 9:04 PM, Junio C Hamano wrote:
>>> Christian Couder writes:
>>>
Highlevel view of the patches in the series
~~~
This is "par
On Thu, Sep 1, 2016 at 12:20 AM, Stefan Beller wrote:
> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
> wrote:
>> To avoid printing anything when applying with
>> `state->apply_verbosity == verbosity_silent`, let's save the
>> existing warn and error routines before applying, and let's
>> re
On Wed, Aug 31, 2016 at 11:46 PM, Stefan Beller wrote:
> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
> wrote:
>> extern int check_apply_state(struct apply_state *state, int force_apply);
>>
>
> With greater scope comes greater responsibility. Nit of the day:
> In case a reroll is necessar
On Thu, Sep 1, 2016 at 12:07 AM, Stefan Beller wrote:
>> Printing on stdout, and calls to warning() or error() are not
>> taken care of in this patch, as that will be done in following
>> patches.
>
>> - if (state->apply_verbosely)
>> + if (state->apply_verbosity > verb
On Wed, Aug 31, 2016 at 11:57 PM, Stefan Beller wrote:
> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
> wrote:
>> As most of the apply code in builtin/apply.c has been libified by a number of
>> previous commits, it can now be moved to apply.{c,h}, so that more
On Thu, Sep 1, 2016 at 12:33 AM, Stefan Beller wrote:
> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
> wrote:
>> +
>> + if (opts_left != 0)
>> + die("unknown option passed thru to git apply");
>
> Through and thru are different s
On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
wrote:
> +
> + if (opts_left != 0)
> + die("unknown option passed thru to git apply");
Through and thru are different spellings of the same word.
Thru is the less preferred form, however, and it might b
On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
wrote:
> To avoid printing anything when applying with
> `state->apply_verbosity == verbosity_silent`, let's save the
> existing warn and error routines before applying, and let's
> replace them with a routine that does nothing.
>
> Then after app
Christian Couder writes:
> On Mon, Aug 29, 2016 at 9:04 PM, Junio C Hamano wrote:
>> Christian Couder writes:
>>
>>> Highlevel view of the patches in the series
>>> ~~~
>>>
>>> This is "part 3" of the full patch series. I am resending only the
>>> last 14
> Printing on stdout, and calls to warning() or error() are not
> taken care of in this patch, as that will be done in following
> patches.
> - if (state->apply_verbosely)
> + if (state->apply_verbosity > verbosity_normal)
> error(_("while search
On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
wrote:
> To avoid possible mistakes and to uniformly show the errno
> related messages, let's use error_errno() where possible.
>
> Signed-off-by: Christian Couder
> ---
Looks good,
Thanks for these cleanups!
Stefan
On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
wrote:
> Some parsing functions that were used in both "apply.c" and
> "builtin/apply.c" are now only used in the former, so they
> can be made static to "apply.c".
>
> Signed-off-by: Christian Couder
> ---
> apply.c | 6 +++---
> apply.h | 5 --
On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
wrote:
> As most of the apply code in builtin/apply.c has been libified by a number of
> previous commits, it can now be moved to apply.{c,h}, so that more code can
> use it.
>
> Helped-by: Nguyễn Thái Ngọc Duy
> Helpe
On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
wrote:
> extern int check_apply_state(struct apply_state *state, int force_apply);
>
With greater scope comes greater responsibility. Nit of the day:
In case a reroll is necessary, consider putting a comment here.
(What are these constants? what
Dear Sir/Madam,
We give out urgent loan for business and personal purpose with 3% intrest rate
applicable to all amount.
Kindly get back to us via email: loa...@foxmail.com for further details on how
to apply.
On Mon, Aug 29, 2016 at 9:04 PM, Junio C Hamano wrote:
> Christian Couder writes:
>
>> Highlevel view of the patches in the series
>> ~~~
>>
>> This is "part 3" of the full patch series. I am resending only the
>> last 14 patches of the full series as "part
Junio C Hamano writes:
> Christian Couder writes:
>
>> Highlevel view of the patches in the series
>> ~~~
>>
>> This is "part 3" of the full patch series. I am resending only the
>> last 14 patches of the full series as "part 3", because I don't want
>> to
Christian Couder writes:
> Highlevel view of the patches in the series
> ~~~
>
> This is "part 3" of the full patch series. I am resending only the
> last 14 patches of the full series as "part 3", because I don't want
> to resend the first 27 patches of v1
1_prefix) != GIT_SHA1_HEXSZ ||
+ get_oid_hex(patch->old_sha1_prefix, &oid) ||
+ get_oid_hex(patch->new_sha1_prefix, &oid))
return error("cannot apply binary patch to '%s' "
"without full index line", name
On Sat, Aug 27, 2016 at 8:45 PM, Christian Couder
wrote:
>
> I will send a diff between this version and v12 as a reply to this
> email.
Here is the diff:
diff --git a/apply.c b/apply.c
index 7e561a4..5cd037d 100644
--- a/apply.c
+++ b/apply.c
@@ -3993,12 +3993,21 @@ static int check_patch_list(
Parsing `git apply` options can be useful to other commands that
want to call the libified apply functionality, because this way
they can easily pass some options from their own command line to
the libified apply functionality.
This will be used by `git am` in a following patch.
To make this
Goal
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 backend, is also significan
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
Sometimes we want to apply in a different index file.
Before the apply functionality was libified it was possible to
use the GIT_INDEX_FILE environment variable, for this purpose.
But now, as the apply functionality has been libified, it should
be possible to do that in a libified way.
Signed
To libify git apply functionality, we will need to read from a
different index file in get_current_sha1(). This index file will be
stored in "struct apply_state", so let's pass the state to
build_fake_ancestor() which will later pass it to get_current_sha1().
Signed-off-by: C
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 deletions(-)
diff --
To avoid possible mistakes and to uniformly show the errno
related messages, let's use error_errno() where possible.
Signed-off-by: Christian Couder
---
apply.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/apply.c b/apply.c
index c0cb3f5..41a33d3 100644
into 'verbosity_verbose'.
The new added state is 'verbosity_silent'. It should prevent
anything to be printed on both stderr and stdout.
This is needed because `git am` wants to first call apply
functionality silently, if it can then fall back on 3-way merge
in case of error.
Printing
To avoid printing anything when applying with
`state->apply_verbosity == verbosity_silent`, let's save the
existing warn and error routines before applying, and let's
replace them with a routine that does nothing.
Then after applying, let's restore the saved routines.
Helped-by: Stefan Beller
Si
When apply_verbosity is set to verbosity_silent nothing should be
printed on both stderr and stdout.
To avoid printing on stdout, we can just skip calling the following
functions:
- stat_patch_list(),
- numstat_patch_list(),
- summary_patch_list().
It is safe to do that b
Some parsing functions that were used in both "apply.c" and
"builtin/apply.c" are now only used in the former, so they
can be made static to "apply.c".
Signed-off-by: Christian Couder
---
apply.c | 6 +++---
apply.h | 5 -
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/apply.
ly.c
index 429fe44..9c396bb 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -4463,9 +4463,6 @@ static int write_out_results(struct apply_state *state,
struct patch *list)
static struct lock_file lock_file;
-#define INACCURATE_EOF (1<<0)
-#define RECOUNT(1<<1)
-
/*
On Thu, Aug 11, 2016 at 10:17 PM, Junio C Hamano wrote:
> Christian Couder writes:
>
>> Sometimes we want to apply in a different index file.
>>
>> Before the apply functionality was libified it was possible to
>> use the GIT_INDEX_FILE environment variable, for t
Christian Couder writes:
> Sometimes we want to apply in a different index file.
>
> Before the apply functionality was libified it was possible to
> use the GIT_INDEX_FILE environment variable, for this purpose.
>
> But now, as the apply functionality has been libified, it sh
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
To avoid printing anything when applying with
`state->apply_verbosity == verbosity_silent`, let's save the
existing warn and error routines before applying, and let's
replace them with a routine that does nothing.
Then after applying, let's restore the saved routines.
Helped-by: Stefan Beller
Si
Parsing `git apply` options can be useful to other commands that
want to call the libified apply functionality, because this way
they can easily pass some options from their own command line to
the libified apply functionality.
This will be used by `git am` in a following patch.
To make this
Sometimes we want to apply in a different index file.
Before the apply functionality was libified it was possible to
use the GIT_INDEX_FILE environment variable, for this purpose.
But now, as the apply functionality has been libified, it should
be possible to do that in a libified way.
Signed
into 'verbosity_verbose'.
The new added state is 'verbosity_silent'. It should prevent
anything to be printed on both stderr and stdout.
This is needed because `git am` wants to first call apply
functionality silently, if it can then fall back on 3-way merge
in case of error.
Printing
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 deletions(-)
diff --
ly.c
index 429fe44..9c396bb 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -4463,9 +4463,6 @@ static int write_out_results(struct apply_state *state,
struct patch *list)
static struct lock_file lock_file;
-#define INACCURATE_EOF (1<<0)
-#define RECOUNT(1<<1)
-
/*
Goal
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 backend, is also significan
Some parsing functions that were used in both "apply.c" and
"builtin/apply.c" are now only used in the former, so they
can be made static to "apply.c".
Signed-off-by: Christian Couder
---
apply.c | 6 +++---
apply.h | 5 -
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/apply.
To avoid possible mistakes and to uniformly show the errno
related messages, let's use error_errno() where possible.
Signed-off-by: Christian Couder
---
apply.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/apply.c b/apply.c
index c0cb3f5..41a33d3 100644
When apply_verbosity is set to verbosity_silent nothing should be
printed on both stderr and stdout.
To avoid printing on stdout, we can just skip calling the following
functions:
- stat_patch_list(),
- numstat_patch_list(),
- summary_patch_list().
It is safe to do that b
On Thu, Aug 11, 2016 at 10:58 AM, wrote:
> Am 11.08.2016 um 10:52 schrieb 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
>
> s/api/API/
>
> ;-)
Ooops.
Anyway as this is patch
Am 11.08.2016 um 10:52 schrieb 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
s/api/API/
;-)
> to the apply API.
>
> Signed-off-by: Christian Couder
> ---
Am 11.08.2016 um 10:40 schrieb Christian Couder:
> On Tue, Aug 9, 2016 at 4:51 PM, wrote:
>> Am 08.08.2016 um 23:02 schrieb Christian Couder:
>>> To prepare for some structs and constants being moved from
>>> builtin/apply.c to apply.h, we should give them some more
>>> specific names to avoid po
On Tue, Aug 9, 2016 at 4:51 PM, wrote:
> Am 08.08.2016 um 23:02 schrieb Christian Couder:
>> To prepare for some structs and constants being moved from
>> builtin/apply.c to apply.h, we should give them some more
>> specific names to avoid possible name collisions in th global
>
> s/th/the/
>
>>
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 deletions(-)
diff --
message updates in those 2 patches.
I hope that it will make it possible to merge the first 32
patches or so of this series.
As usual cou can get the full series from:
https://github.com/chriscool/git/commits/libify-apply-use-in-am
builtin/apply.c | 20 ++--
1 file changed, 10
Am 08.08.2016 um 23:02 schrieb Christian Couder:
> To prepare for some structs and constants being moved from
> builtin/apply.c to apply.h, we should give them some more
> specific names to avoid possible name collisions in th global
s/th/the/
> namespace.
>
> Signed-off-by: Christian Couder
>
Am 08.08.2016 um 23:03 schrieb 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.
s/api/API/
>
> Signed-off-by: Christian Couder
> ---
Christian Couder writes:
> diff --git a/apply.h b/apply.h
> index 27a3a7a..e2b89e8 100644
> --- a/apply.h
> +++ b/apply.h
> @@ -16,7 +16,7 @@ enum apply_ws_ignore {
> enum apply_verbosity {
> verbosity_silent = -1,
> verbosity_normal = 0,
> -verbosity_verbose = 1,
> +verbosity_
r *get_index_file(void);
extern char *get_graft_file(void);
extern int set_git_dir(const char *path);
@@ -472,6 +471,19 @@ extern const char *strip_namespace(const char
*namespaced_ref);
extern const char *get_git_work_tree(void);
/*
+ * Hack to temporarily change the index.
+ * Yeah, the
To libify `git apply` functionality we have to signal errors to the
caller instead of exit()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", write_out_one_result() should just return what
remove_file() and create_file() are returning
To avoid printing anything when applying with
`state->apply_verbosity == verbosity_silent`, let's save the
existing warn and error routines before applying, and let's
replace them with a routine that does nothing.
Then after applying, let's restore the saved routines.
Helped-by: Stefan Beller
Si
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", try_create_file() should return -1 in case of
error.
Unfortunately try_create_file() currently ret
To libify `git apply` functionality we have to signal errors to the
caller instead of exit()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", create_one_file() should return -1 instead of
calling exit().
Signed-off-by: Christian Couder
--
To avoid possible mistakes and to uniformly show the errno
related messages, let's use error_errno() where possible.
Signed-off-by: Christian Couder
---
apply.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/apply.c b/apply.c
index c0cb3f5..41a33d3 100644
ly.c
index 429fe44..9c396bb 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -4463,9 +4463,6 @@ static int write_out_results(struct apply_state *state,
struct patch *list)
static struct lock_file lock_file;
-#define INACCURATE_EOF (1<<0)
-#define RECOUNT(1<<1)
-
/*
into 'verbosity_verbose'.
The new added state is 'verbosity_silent'. It should prevent
anything to be printed on both stderr and stdout.
This is needed because `git am` wants to first call apply
functionality silently, if it can then fall back on 3-way merge
in case of error.
Printing
Parsing `git apply` options can be useful to other commands that
want to call the libified apply functionality, because this way
they can easily pass some options from their own command line to
the libified apply functionality.
This will be used by `git am` in a following patch.
To make this
The gitdiff_*() functions that are called as p->fn() in parse_git_header()
should return 1 instead of -1 in case of end of header or unrecognized
input, as these are not real errors. It just instructs the parser to break
out.
This makes it possible for gitdiff_*() functions to return -1 in case of
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
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in builtin/apply.c, parse_whitespace_option() should return -1 instead
of calling die().
Signed-off-by: Christian Couder
401 - 500 of 1632 matches
Mail list logo