Skip to content

Commit 7aa2da6

Browse files
committed
Merge branch 'pt/am-builtin'
Rewrite "am" in "C". * pt/am-builtin: (46 commits) git-am: add am.threeWay config variable builtin-am: remove redirection to git-am.sh builtin-am: check for valid committer ident builtin-am: implement legacy -b/--binary option builtin-am: implement -i/--interactive builtin-am: support and auto-detect mercurial patches builtin-am: support and auto-detect StGit series files builtin-am: support and auto-detect StGit patches builtin-am: rerere support builtin-am: invoke post-applypatch hook builtin-am: invoke pre-applypatch hook builtin-am: invoke applypatch-msg hook builtin-am: support automatic notes copying builtin-am: invoke post-rewrite hook builtin-am: implement -S/--gpg-sign, commit.gpgsign builtin-am: implement --committer-date-is-author-date builtin-am: implement --ignore-date builtin-am: pass git-apply's options to git-apply builtin-am: implement --[no-]scissors builtin-am: support --keep-cr, am.keepcr ...
2 parents c1e5ca9 + e97a5e7 commit 7aa2da6

File tree

12 files changed

+2432
-15
lines changed

12 files changed

+2432
-15
lines changed

Documentation/config.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,14 @@ am.keepcr::
769769
by giving '--no-keep-cr' from the command line.
770770
See linkgit:git-am[1], linkgit:git-mailsplit[1].
771771

772+
am.threeWay::
773+
By default, `git am` will fail if the patch does not apply cleanly. When
774+
set to true, this setting tells `git am` to fall back on 3-way merge if
775+
the patch records the identity of blobs it is supposed to apply to and
776+
we have those blobs available locally (equivalent to giving the `--3way`
777+
option from the command line). Defaults to `false`.
778+
See linkgit:git-am[1].
779+
772780
apply.ignoreWhitespace::
773781
When set to 'change', tells 'git apply' to ignore changes in
774782
whitespace, in the same way as the '--ignore-space-change'

Documentation/git-am.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8]
13-
[--3way] [--interactive] [--committer-date-is-author-date]
13+
[--[no-]3way] [--interactive] [--committer-date-is-author-date]
1414
[--ignore-date] [--ignore-space-change | --ignore-whitespace]
1515
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
1616
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
@@ -90,10 +90,13 @@ default. You can use `--no-utf8` to override this.
9090

9191
-3::
9292
--3way::
93+
--no-3way::
9394
When the patch does not apply cleanly, fall back on
9495
3-way merge if the patch records the identity of blobs
9596
it is supposed to apply to and we have those blobs
96-
available locally.
97+
available locally. `--no-3way` can be used to override
98+
am.threeWay configuration variable. For more information,
99+
see am.threeWay in linkgit:git-config[1].
97100

98101
--ignore-space-change::
99102
--ignore-whitespace::

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ TEST_PROGRAMS_NEED_X =
467467
# interactive shell sessions without exporting it.
468468
unexport CDPATH
469469

470-
SCRIPT_SH += git-am.sh
471470
SCRIPT_SH += git-bisect.sh
472471
SCRIPT_SH += git-difftool--helper.sh
473472
SCRIPT_SH += git-filter-branch.sh
@@ -813,6 +812,7 @@ LIB_OBJS += xdiff-interface.o
813812
LIB_OBJS += zlib.o
814813

815814
BUILTIN_OBJS += builtin/add.o
815+
BUILTIN_OBJS += builtin/am.o
816816
BUILTIN_OBJS += builtin/annotate.o
817817
BUILTIN_OBJS += builtin/apply.o
818818
BUILTIN_OBJS += builtin/archive.o

builtin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern int textconv_object(const char *path, unsigned mode, const unsigned char
3030
extern int is_builtin(const char *s);
3131

3232
extern int cmd_add(int argc, const char **argv, const char *prefix);
33+
extern int cmd_am(int argc, const char **argv, const char *prefix);
3334
extern int cmd_annotate(int argc, const char **argv, const char *prefix);
3435
extern int cmd_apply(int argc, const char **argv, const char *prefix);
3536
extern int cmd_archive(int argc, const char **argv, const char *prefix);

0 commit comments

Comments
 (0)