<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/apply.h, branch v2.14.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.14.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.14.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-08-09T17:21:45Z</updated>
<entry>
<title>apply: remove prefix_length member from apply_state</title>
<updated>2017-08-09T17:21:45Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-08-09T15:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=881529c84656e7ff41379c0684df0ff9a796d444'/>
<id>urn:sha1:881529c84656e7ff41379c0684df0ff9a796d444</id>
<content type='text'>
Use a NULL-and-NUL check to see if we have a prefix and consistently use
C string functions on it instead of storing its length in a member of
struct apply_state.  This avoids strlen() calls and simplifies the code.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: learn to use a different index file</title>
<updated>2016-09-07T19:29:54Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-09-04T20:18:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5b0b57fd91ce684679fdac1c3ae3a50c6aa3943e'/>
<id>urn:sha1:5b0b57fd91ce684679fdac1c3ae3a50c6aa3943e</id>
<content type='text'>
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-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: refactor `git apply` option parsing</title>
<updated>2016-09-07T19:29:53Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-09-04T20:18:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e1bad24e3b7f220813d8a449f19652113edb923'/>
<id>urn:sha1:7e1bad24e3b7f220813d8a449f19652113edb923</id>
<content type='text'>
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 possible, let's refactor the `git apply` option
parsing code into a new libified apply_parse_options() function.

Doing that makes it possible to remove some functions definitions
from "apply.h" and make them static in "apply.c".

Helped-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: change error_routine when silent</title>
<updated>2016-09-07T19:29:53Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-09-04T20:18:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45b78d8ba3c9e542f1375171090fe10baef6b2b2'/>
<id>urn:sha1:45b78d8ba3c9e542f1375171090fe10baef6b2b2</id>
<content type='text'>
To avoid printing anything when applying with
`state-&gt;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.

Note that, as we need to restore the saved routines in all
cases, we cannot return early any more in apply_all_patches().

Helped-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: make it possible to silently apply</title>
<updated>2016-09-07T19:29:53Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-09-04T20:18:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a46160d27ebdcd609aeae60b6163548af337d280'/>
<id>urn:sha1:a46160d27ebdcd609aeae60b6163548af337d280</id>
<content type='text'>
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 '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 on stdout, and calls to warning() or error() are not
taken care of in this patch, as that will be done in following
patches.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: make some parsing functions static again</title>
<updated>2016-09-07T19:29:53Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-09-04T20:18:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9123d5ddfe1c701a47d034403d302d57acf3e8bb'/>
<id>urn:sha1:9123d5ddfe1c701a47d034403d302d57acf3e8bb</id>
<content type='text'>
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 &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: move libified code from builtin/apply.c to apply.{c,h}</title>
<updated>2016-09-07T19:29:53Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2016-04-22T18:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=13b5af22f39f5e7d952a4c98ffb7ea25053800c1'/>
<id>urn:sha1:13b5af22f39f5e7d952a4c98ffb7ea25053800c1</id>
<content type='text'>
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 &lt;pclouds@gmail.com&gt;
Helped-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: rename and move opt constants to apply.h</title>
<updated>2016-09-07T19:29:53Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-09-04T20:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=803bf4e012687d92f4c136febe0881852738d57d'/>
<id>urn:sha1:803bf4e012687d92f4c136febe0881852738d57d</id>
<content type='text'>
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 &lt;sbeller@google.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/apply: move check_apply_state() to apply.c</title>
<updated>2016-08-11T19:41:47Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-08-08T21:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6446d54ec70817ddd96b5c9668dd74a996719bf'/>
<id>urn:sha1:b6446d54ec70817ddd96b5c9668dd74a996719bf</id>
<content type='text'>
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 &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>apply: make init_apply_state() return -1 instead of exit()ing</title>
<updated>2016-08-11T19:41:47Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-08-08T21:03:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f5a6d1218de4dfa326ff289b784d3e293b8141f'/>
<id>urn:sha1:2f5a6d1218de4dfa326ff289b784d3e293b8141f</id>
<content type='text'>
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 &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
