git/builtin
Junio C Hamano d96855ff51 merge-base: teach "--fork-point" mode
The "git pull --rebase" command computes the fork point of the
branch being rebased using the reflog entries of the "base" branch
(typically a remote-tracking branch) the branch's work was based on,
in order to cope with the case in which the "base" branch has been
rewound and rebuilt.  For example, if the history looked like this:

                     o---B1
                    /
    ---o---o---B2--o---o---o---Base
            \
             B3
              \
               Derived

where the current tip of the "base" branch is at Base, but earlier
fetch observed that its tip used to be B3 and then B2 and then B1
before getting to the current commit, and the branch being rebased
on top of the latest "base" is based on commit B3, it tries to find
B3 by going through the output of "git rev-list --reflog base" (i.e.
Base, B1, B2, B3) until it finds a commit that is an ancestor of the
current tip "Derived".

Internally, we have get_merge_bases_many() that can compute this
with one-go.  We would want a merge-base between Derived and a
fictitious merge commit that would result by merging all the
historical tips of "base".  When such a commit exist, we should get
a single result, which exactly match one of the reflog entries of
"base".

Teach "git merge-base" a new mode, "--fork-point", to compute
exactly that.

Helped-by: Martin von Zweigbergk <martinvonz@gmail.com>
Helped-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-10-29 13:06:08 -07:00
..
add.c Merge branch 'mm/color-auto-default' 2013-07-22 11:23:10 -07:00
annotate.c
apply.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
archive.c pkt-line: provide a LARGE_PACKET_MAX static buffer 2013-02-20 13:42:22 -08:00
bisect--helper.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
blame.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
branch.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
bundle.c
cat-file.c sha1_object_info_extended: make type calculation optional 2013-07-12 10:16:36 -07:00
check-attr.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
check-ignore.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
check-mailmap.c builtin: add git-check-mailmap command 2013-07-13 10:19:37 -07:00
check-ref-format.c
checkout-index.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
checkout.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
clean.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
clone.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
column.c i18n: column: mark parseopt strings for translation 2012-08-20 12:23:16 -07:00
commit-tree.c commit-tree: document -S option consistently 2013-03-25 15:01:22 -07:00
commit.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
config.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
count-objects.c count-objects: add -H option to humanize sizes 2013-04-10 13:27:26 -07:00
credential.c
describe.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
diff-files.c
diff-index.c update-index/diff-index: use core.preloadindex to improve performance 2012-11-02 11:38:29 -04:00
diff-tree.c
diff.c cmd_diff(): make it obvious which cases are exclusive of each other 2013-05-28 09:25:01 -07:00
fast-export.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
fetch-pack.c Merge branch 'jk/pkt-line-cleanup' 2013-04-01 08:59:37 -07:00
fetch.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
fmt-merge-msg.c Merge branch 'rt/commentchar-fmt-merge-msg' into maint 2013-04-26 11:10:47 -07:00
for-each-ref.c Merge branch 'nd/i18n-parseopt-help' 2012-09-07 11:09:09 -07:00
fsck.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
gc.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
grep.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
hash-object.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
help.c Merge branch 'ph/builtin-srcs-are-in-subdir-these-days' into maint 2013-07-21 22:51:29 -07:00
index-pack.c clone: open a shortcut for connectivity check 2013-05-28 08:07:20 -07:00
init-db.c i18n: init-db: mark parseopt strings for translation 2012-08-20 12:23:17 -07:00
log.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
ls-files.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
ls-remote.c ls-remote: document the '--get-url' option 2012-09-07 10:58:35 -07:00
ls-tree.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
mailinfo.c Merge branch 'jc/same-encoding' into maint 2012-12-07 14:10:56 -08:00
mailsplit.c mailsplit: sort maildir filenames more cleverly 2013-03-02 22:52:44 -08:00
merge-base.c merge-base: teach "--fork-point" mode 2013-10-29 13:06:08 -07:00
merge-file.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
merge-index.c Convert "struct cache_entry *" to "const ..." wherever possible 2013-07-09 09:12:48 -07:00
merge-ours.c
merge-recursive.c
merge-tree.c merge-tree: handle directory/empty conflict correctly 2013-05-06 22:17:00 -07:00
merge.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
mktag.c
mktree.c i18n: mktree: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
mv.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
name-rev.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
notes.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
pack-objects.c Merge branch 'jk/peel-ref' 2012-10-25 06:42:27 -04:00
pack-redundant.c Fix sizeof usage in get_permutations 2012-12-13 11:13:44 -08:00
pack-refs.c pack-refs: merge code from pack-refs.{c,h} into refs.{c,h} 2013-05-01 15:33:11 -07:00
patch-id.c
prune-packed.c prune-packed: avoid implying "1" is DRY_RUN in prune_packed_objects() 2013-05-28 09:20:54 -07:00
prune.c Merge branch 'nd/prune-packed-dryrun-verbose' 2013-06-06 12:17:52 -07:00
push.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
read-tree.c diff-lib, read-tree, unpack-trees: mark cache_entry array paramters const 2013-06-02 15:31:14 -07:00
receive-pack.c Merge branch 'jk/receive-pack-deadlocks-with-early-failure' into maint 2013-04-26 11:12:17 -07:00
reflog.c Merge branch 'jc/prune-all' 2013-05-29 14:23:04 -07:00
remote-ext.c
remote-fd.c
remote.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
replace.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
rerere.c i18n: rerere: mark parseopt strings for translation 2012-08-20 12:23:19 -07:00
reset.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
rev-list.c pretty: --format output should honor logOutputEncoding 2013-06-26 11:40:31 -07:00
rev-parse.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
revert.c Add the LAST_ARG_MUST_BE_NULL macro 2013-07-19 09:26:15 -07:00
rm.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
send-pack.c teach get_remote_heads to read from a memory buffer 2013-02-24 00:17:38 -08:00
shortlog.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
show-branch.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
show-ref.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
stripspace.c Allow custom "comment char" 2013-01-16 12:48:22 -08:00
symbolic-ref.c git symbolic-ref --delete $symref 2012-10-21 12:17:38 -07:00
tag.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
tar-tree.c
unpack-file.c
unpack-objects.c
update-index.c Convert "struct cache_entry *" to "const ..." wherever possible 2013-07-09 09:12:48 -07:00
update-ref.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
update-server-info.c i18n: update-server-info: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
upload-archive.c pkt-line: provide a LARGE_PACKET_MAX static buffer 2013-02-20 13:42:22 -08:00
var.c
verify-pack.c i18n: verify-pack: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
verify-tag.c gpg_interface: allow to request status return 2013-02-14 09:30:04 -08:00
write-tree.c i18n: write-tree: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00