Document git-merge-cache -o
[git.git] / Documentation / git-merge-cache.txt
1 git-merge-cache(1)
2 ==================
3 v0.1, May 2005
4
5 NAME
6 ----
7 git-merge-cache - Runs a merge for files needing merging
8
9
10 SYNOPSIS
11 --------
12 'git-merge-cache' [-o] <merge-program> (-a | -- | <file>\*) 
13
14 DESCRIPTION
15 -----------
16 This looks up the <file>(s) in the cache and, if there are any merge
17 entries, passes the SHA1 hash for those files as arguments 1, 2, 3 (empty
18 argument if no file), and <file> as argument 4.  File modes for the three
19 files are passed as arguments 5, 6 and 7.
20
21 OPTIONS
22 -------
23 --::
24         Interpret all future arguments as filenames.
25
26 -a::
27         Run merge against all files in the cache that need merging.
28
29 -o::
30         Instead of stopping at the first failed merge, do all of them
31         in one shot - continue with merging even when previous merges
32         returned errors, and only return the error code after all the
33         merges are over.
34
35 If "git-merge-cache" is called with multiple <file>s (or -a) then it
36 processes them in turn only stopping if merge returns a non-zero exit
37 code.
38
39 Typically this is run with the a script calling the merge command from
40 the RCS package.
41
42 A sample script called "git-merge-one-file-script" is included in the
43 ditribution.
44
45 ALERT ALERT ALERT! The git "merge object order" is different from the
46 RCS "merge" program merge object order. In the above ordering, the
47 original is first. But the argument order to the 3-way merge program
48 "merge" is to have the original in the middle. Don't ask me why.
49
50 Examples:
51
52   torvalds@ppc970:~/merge-test> git-merge-cache cat MM
53   This is MM from the original tree.                    # original
54   This is modified MM in the branch A.                  # merge1
55   This is modified MM in the branch B.                  # merge2
56   This is modified MM in the branch B.                  # current contents
57
58 or 
59
60   torvalds@ppc970:~/merge-test> git-merge-cache cat AA MM
61   cat: : No such file or directory
62   This is added AA in the branch A.
63   This is added AA in the branch B.
64   This is added AA in the branch B.
65   fatal: merge program failed
66
67 where the latter example shows how "git-merge-cache" will stop trying to
68 merge once anything has returned an error (ie "cat" returned an error
69 for the AA file, because it didn't exist in the original, and thus
70 "git-merge-cache" didn't even try to merge the MM thing).
71
72 Author
73 ------
74 Written by Linus Torvalds <torvalds@osdl.org>
75 One-shot merge by Petr Baudis <pasky@ucw.cz>
76
77 Documentation
78 --------------
79 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
80
81 GIT
82 ---
83 Part of the link:git.html[git] suite
84