Hi Josh,
On Sat, 3 Sep 2016, Josh Triplett wrote:
> On Fri, Sep 02, 2016 at 06:23:42PM +0200, Johannes Schindelin wrote:
> > Let's reimplement this with linear complexity (using a hash map to
> > match the commits' subject lines) for the common case; Sadly, the
> > fixup/squash feature's design
Jakub Narębski writes:
> Side note: I wonder if the cousin of unified diff, namely context diff[1],
> is something that we can and should support.
Yes, the lack of support for the copied context (instead of the
unified context) diff format has bugged me over the years.
Jeff King writes:
>> diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
>> index 92df596..af11cff 100644
>> --- a/Documentation/git-stash.txt
>> +++ b/Documentation/git-stash.txt
>> @@ -35,11 +35,12 @@ A stash is by default listed as "WIP on
>> 'branchname'
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 439c500..c544de8 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 9 +
refs/files-backend.c | 7 ++-
refs/refs-internal.h | 5 +
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index
From: David Turner
Signed-off-by: Ronnie Sahlberg
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index ab2c1de..3a0db5a 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 2 +-
refs/files-backend.c | 4 ++--
refs/refs-internal.h | 8
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index
From: David Turner
Instead of including a files-backend-specific struct ref_lock, change
the generic ref_update struct to include a void pointer that backends
can use for their own arbitrary data.
Signed-off-by: David Turner
Signed-off-by:
From: David Turner
Alternate refs backends might not need the refs/heads directory and so
on, so we make ref db initialization part of the backend.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by:
From: David Turner
Alternate refs backends might still use files to store per-worktree
refs. So provide a way to iterate over only the per-worktree references
in a ref_store. The other backend can set up a files ref_store and
iterate using the new
resolve_ref_recursively() can handle references in arbitrary files
reference stores, so use it to resolve "gitlink" (i.e., submodule)
references. Aside from removing redundant code, this allows submodule
lookups to benefit from the much more robust code that we use for
reading non-submodule
From: Ronnie Sahlberg
Add a `struct ref_storage_be` to represent types of reference stores. In
OO notation, this is the class, and will soon hold some class
methods (e.g., a factory to create new ref_store instances) and will
also serve as the vtable for ref_store instances
The greater goal of this patch series is to develop the concept of a
reference store, which is a place that references, their values, and
their reflogs are stored, and to virtualize the reference interface so
that different types of ref_stores can be implemented. We will then, for
example, use
This is v2 of the patch series to virtualize the references API
(though earlier patch series similar in spirit were submitted by
Ronnie Sahlberg and David Turner). Thanks to Junio, Eric, and Ramsay
for their comments about v1 [1].
Nobody pointed out any fundamental problems with v1, but this
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2fc8ec9..0c92ace 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 12290d2..74c2c47 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c544de8..2fc8ec9 100644
---
From: Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Jeff King
Signed-off-by: Michael Haggerty
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 13 +++--
refs.h | 9 +
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/refs.c b/refs.c
index 34c0c5e..e881874 100644
--- a/refs.c
+++ b/refs.c
From: David Turner
And improve the internal variable names.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
And make the function work for submodules.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 4 +++-
refs/files-backend.c | 18 +-
refs/refs-internal.h | 9 ++---
3 files changed, 22
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 2 +-
refs/files-backend.c | 3 ++-
refs/refs-internal.h | 24
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/refs.c
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 363f306..ae425c5 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8d43e0b..363f306 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 7 +++
refs/files-backend.c | 6 --
refs/refs-internal.h | 4
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index
From: David Turner
In the file-based backend, the reflog piggybacks on the ref lock.
Since other backends won't have the same sort of ref lock, ref backends
must also handle reflogs.
Signed-off-by: Ronnie Sahlberg
Signed-off-by: David Turner
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index ae425c5..001b8ef 100644
---
Add a new function, resolve_ref_recursively(), which is basically like
the old resolve_ref_unsafe() except that it takes a (ref_store *)
argument and also works for submodules.
Re-implement resolve_ref_unsafe() as a thin wrapper around
resolve_ref_recursively().
Signed-off-by: Michael Haggerty
Reference backends will be able to customize this function to implement
reference reading.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 4 ++--
refs/files-backend.c | 14 --
refs/refs-internal.h |
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 7673342..32ca5ff 100644
---
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 10 ++
refs/files-backend.c | 14 --
refs/refs-internal.h | 7 +++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/refs.c
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2f8eb54..ab2c1de
If we don't have to strip trailing '/' from the submodule path, then
don't allocate and copy the submodule name.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 19 +--
1 file changed, 13 insertions(+), 6
Move resolve_gitlink_ref() and related functions lower in the file to
avoid the need for forward declarations in the next step.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 166
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
>>>
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
Now that resolve_packed_ref() can work with an arbitrary
files_ref_store, there is no need to have a separate
resolve_gitlink_packed_ref() function.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 26
From: David Turner
This removes the last caller of function get_files_ref_store(), so
remove it.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
From: David Turner
In the file-based backend, delete_refs has some special optimization
to deal with packed refs. In other backends, we might be able to make
ref deletion faster by putting all deletions into a single
transaction. So we need a special backend function
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 001b8ef..2f8eb54 100644
---
These functions currently only work in the main repository, so add an
assert_main_repository() check to each function.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs/files-backend.c | 32
1 file
For now it only supports the main reference store.
Signed-off-by: Michael Haggerty
Signed-off-by: Junio C Hamano
---
refs.c | 7 +++
refs/files-backend.c | 6 --
refs/refs-internal.h | 3 +++
3 files changed, 14 insertions(+), 2
We want ref_stores to be polymorphic, so invent a base class of which
files_ref_store is a derived class. For now there is exactly one
ref_store for the main repository and one for any submodules whose
references have been accessed.
Signed-off-by: Michael Haggerty
Hi,
On Sat, 3 Sep 2016, Jeff King wrote:
> On Sat, Sep 03, 2016 at 07:21:18PM -0400, Aaron M Watson wrote:
>
> > Allows stashes to be referenced by index only. Instead of referencing
> > "stash@{n}" explicitly, it can simply be referenced as "n".
>
> This says "what" but not "why". I assume it
Hi Peff,
On Fri, 2 Sep 2016, Jeff King wrote:
> The good news (or maybe the bad) is that "add -p" is implemented
> entirely in Perl. :)
Yeah, you would definitely not call this "good news" if you were in my
shoes.
There is no question that it has grown way too unwieldy and that we (once
again,
On Sat, Sep 3, 2016 at 11:41 PM, Junio C Hamano wrote:
> Stefan Beller writes:
>
>>> * On 2/2, doing it at xdiff.c level may be limiting this good idea
>>>to flourish to its full potential, as the interface is fed only
>>>one diff_filepair at a
Johannes Schindelin writes:
> Hi,
>
> On Fri, 2 Sep 2016, Matthieu Moy wrote:
>
>> Johannes Schindelin writes:
>>
>> > Hi Ævar,
>> >
>> > On Fri, 2 Sep 2016, Ævar Arnfjörð Bjarmason wrote:
>> >
>> >> This might be me missing the point,
W dniu 04.09.2016 o 07:31, Stefan Beller pisze:
> On Sat, Sep 3, 2016 at 5:25 AM, Jakub Narębski wrote:
>> W dniu 03.09.2016 o 05:31, Stefan Beller pisze:
>>
>>> When moving code (e.g. a function is moved to another part of the file or
>>> to a different file), the review
From: "Johannes Schindelin"
Hi Junio & Philip,
On Fri, 2 Sep 2016, Junio C Hamano wrote:
"Philip Oakley" writes:
> As I understand this it's implied by design. The issue is that the
> rebase is looking for that named commit within its
Stefan Beller writes:
>> * On 2/2, doing it at xdiff.c level may be limiting this good idea
>>to flourish to its full potential, as the interface is fed only
>>one diff_filepair at a time.
>
> I realized that after I implemented it. I agree we would want to have
> it
Satoshi Yasushima writes:
> Signed-off-by: Satoshi Yasushima
> ---
I couldn't quite read/parse the title, but luckily I read Japanese ;-)
You saw different Japanese words used to translate the same original
word "remote" in different message
Hi René,
On Sat, 3 Sep 2016, René Scharfe wrote:
> Add and use a helper function that decodes the char value of two
> hexadecimal digits. It returns a negative number on error, avoids
> running over the end of the given string and doesn't shift negative
> values.
I like it! Maybe stress a
Hi René,
I imagine you Cc:ed me because the nedmalloc stuff came in via the Windows
port, contributed by Marius (who is no longer active on the Git project
because it works well enough for him)?
On Sat, 3 Sep 2016, René Scharfe wrote:
> Move our implementation of strdup(3) out of
On Fri, Sep 2, 2016 at 8:31 PM, Stefan Beller wrote:
> When moving code (e.g. a function is moved to another part of the file or
> to a different file), the review process is different than reviewing new
> code. When reviewing moved code we are only interested in the diff as
>
From: "Johannes Schindelin"
Hi,
On Sat, 3 Sep 2016, Jeff King wrote:
On Sat, Sep 03, 2016 at 07:21:18PM -0400, Aaron M Watson wrote:
> Allows stashes to be referenced by index only. Instead of referencing
> "stash@{n}" explicitly, it can simply be referenced as
W dniu 03.09.2016 o 16:43, Satoshi Yasushima pisze:
> msgid "Tracking branch %s is not a branch in the remote repository."
> -msgstr "トラッキング・ブランチ %s は遠隔リポジトリのブランチではありません。"
> +msgstr ""
What for is the above part of change (empty string)?
> +"トラッキング・ブランチ %s はリモートリポジトリのブランチではありません。"
--
Jakub
Hi Beau,
On Fri, 2 Sep 2016, Beau Martinez wrote:
> Hi git developers and community,
>
> I'd like to inquire as to why `git add -p` can only split hunks so
> much. The limit is too large; why can't you split until each hunk is
> only a line? I often have to run `edit` and split them manually
>
Hi,
On Fri, 2 Sep 2016, Matthieu Moy wrote:
> Johannes Schindelin writes:
>
> > Hi Ævar,
> >
> > On Fri, 2 Sep 2016, Ævar Arnfjörð Bjarmason wrote:
> >
> >> On Wed, Aug 31, 2016 at 5:05 PM, Johannes Schindelin
> >> wrote:
> >>
> >> > The
While the chmod options for update-index and the add have the same
functionality, they are using different ways to parse and handle the
option internally. Unify these modes in order to make further
refactoring simpler.
Signed-off-by: Thomas Gummerer
---
As there are chmod options for both add and update-index, introduce a
new chmod_index_entry function to do the work. Use it in update-index,
while it will be used in add in the next patch.
Signed-off-by: Thomas Gummerer
---
builtin/update-index.c | 8 +---
cache.h
When the chmod option was added to git add, it was hooked up to the diff
machinery, meaning that it only works when the version in the index
differs from the version on disk.
As the option was supposed to mirror the chmod option in update-index,
which always changes the mode in the index,
The git add --chmod option was introduced in 4e55ed3 ("add: add
--chmod=+x / --chmod=-x options", 2016-05-31), but was never
documented. Document the feature.
Signed-off-by: Thomas Gummerer
---
Documentation/git-add.txt | 7 ++-
1 file changed, 6 insertions(+), 1
Thanks to Peff and Junio for your inputs on the best way to solve this
problem.
The patch series is made up as follows:
[1/4]: Documentation for the chmod option
[2,3/4]: Small refactoring to simplify the final step
[4/4]: The actual change that introduces the new behaviour.
Thomas Gummerer
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 significantly
faster.
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 ++--
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 that we
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 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 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: Christian Couder
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: Christian Couder
---
apply.h | 100
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()
return
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: 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", gitdiff_*() functions should return -1 instead
of calling die().
A previous patch made it possible for
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
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
On Sun, 2016-09-04 at 18:08 +0200, Michael Haggerty wrote:
> +/* A linked list of ref_stores for submodules: */
> +static struct ref_store *submodule_ref_stores;
I don't like the per-submodule stores being in a linked list, which
requires a linear search. Stefan has, I think, been doing a bunch
The constants for the "inaccurate-eof" and the "recount" options will
be used in both "apply.c" and "builtin/apply.c", so they need to go
into "apply.h", and therefore they need a name that is more specific
to the API they belong to.
Helped-by: Stefan Beller
Signed-off-by:
There are already set_die_routine() and set_error_routine(),
so let's add set_warn_routine() as this will be needed in a
following commit.
Signed-off-by: Christian Couder
---
git-compat-util.h | 1 +
usage.c | 5 +
2 files changed, 6 insertions(+)
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 | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/apply.c b/apply.c
index
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
Let's make it possible to get the current error_routine and warn_routine,
so that we can store them before using set_error_routine() or
set_warn_routine() to use new ones.
This way we will be able put back the original routines, when we are done
with using new ones.
Signed-off-by: Christian
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
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, unfortunately
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
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: Christian Couder
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
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 instead of
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 | 1 +
From: Stefan Beller
When we color the diff, we'll mark moved lines with a different color.
This is achieved by doing a two passes over the diff. The first pass
will inspect each line of the diff and store the removed lines and the
added lines in its own hash map.
The second
On Sun, 2016-09-04 at 18:08 +0200, Michael Haggerty wrote:
> From: Ronnie Sahlberg
>
> Add a `struct ref_storage_be` to represent types of reference stores. In
> OO notation, this is the class, and will soon hold some class
> methods (e.g., a factory to create new ref_store
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_single_patch() should return a negative
integer instead of calling die().
Let's do that by using error()
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", add_conflicted_stages_file() should return -1
instead of calling die().
Helped-by: Eric Sunshine
This changes 'int apply_verbosely' into 'enum apply_verbosity', and
changes the possible values of the variable from a bool to
a tristate.
The previous 'false' state is changed into 'verbosity_normal'.
The previous 'true' state is changed into 'verbosity_verbose'.
The new added state is
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
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: 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", add_index_file() should return -1 instead of
calling die().
Signed-off-by: Christian Couder
1 - 100 of 113 matches
Mail list logo