aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-merge-file.txt
diff options
context:
space:
mode:
authorbrian m. carlson <bk2204@github.com>2023-11-01 19:24:19 +0000
committerJunio C Hamano <gitster@pobox.com>2023-11-02 08:51:40 +0900
commite1068f0ad40f8e724513885e5a9ebb8548885e02 (patch)
treee9f1beca9c57b86d992d54598b78e1f6b748698b /Documentation/git-merge-file.txt
parent8077612ea12e80b20e307e279916710b99fe6362 (diff)
downloadgit-e1068f0ad40f8e724513885e5a9ebb8548885e02.tar.gz
merge-file: add an option to process object IDs
git merge-file knows how to merge files on the file system already. It would be helpful, however, to allow it to also merge single blobs. Teach it an `--object-id` option which means that its arguments are object IDs and not files to allow it to do so. We handle the empty blob specially since read_mmblob doesn't read it directly and otherwise users cannot specify an empty ancestor. Signed-off-by: brian m. carlson <bk2204@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-merge-file.txt')
-rw-r--r--Documentation/git-merge-file.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt
index bf0a18cf02..6a081eacb7 100644
--- a/Documentation/git-merge-file.txt
+++ b/Documentation/git-merge-file.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
[--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
- [--[no-]diff3] <current> <base> <other>
+ [--[no-]diff3] [--object-id] <current> <base> <other>
DESCRIPTION
@@ -41,6 +41,10 @@ however, these conflicts are resolved favouring lines from `<current>`,
lines from `<other>`, or lines from both respectively. The length of the
conflict markers can be given with the `--marker-size` option.
+If `--object-id` is specified, exactly the same behavior occurs, except that
+instead of specifying what to merge as files, it is specified as a list of
+object IDs referring to blobs.
+
The exit value of this program is negative on error, and the number of
conflicts otherwise (truncated to 127 if there are more than that many
conflicts). If the merge was clean, the exit value is 0.
@@ -53,6 +57,14 @@ linkgit:git[1].
OPTIONS
-------
+--object-id::
+ Specify the contents to merge as blobs in the current repository instead of
+ files. In this case, the operation must take place within a valid repository.
++
+If the `-p` option is specified, the merged file (including conflicts, if any)
+goes to standard output as normal; otherwise, the merged file is written to the
+object store and the object ID of its blob is written to standard output.
+
-L <label>::
This option may be given up to three times, and
specifies labels to be used in place of the
@@ -94,6 +106,11 @@ EXAMPLES
merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels
`a` and `c` instead of `tmp/a123` and `tmp/c345`.
+`git merge-file -p --object-id abc1234 def567 890abcd`::
+
+ combines the changes of the blob abc1234 and 890abcd since def567,
+ tries to merge them and writes the result to standard output
+
GIT
---
Part of the linkgit:git[1] suite