提交 1e49cb8a 编写于 作者: J Junio C Hamano

Merge branch 'js/c-merge-recursive'

* js/c-merge-recursive: (21 commits)
  discard_cache(): discard index, even if no file was mmap()ed
  merge-recur: do not die unnecessarily
  merge-recur: try to merge older merge bases first
  merge-recur: if there is no common ancestor, fake empty one
  merge-recur: do not setenv("GIT_INDEX_FILE")
  merge-recur: do not call git-write-tree
  merge-recursive: fix rename handling
  .gitignore: git-merge-recur is a built file.
  merge-recur: virtual commits shall never be parsed
  merge-recur: use the unpack_trees() interface instead of exec()ing read-tree
  merge-recur: fix thinko in unique_path()
  Makefile: git-merge-recur depends on xdiff libraries.
  merge-recur: Explain why sha_eq() and struct stage_data cannot go
  merge-recur: Cleanup last mixedCase variables...
  merge-recur: Fix compiler warning with -pedantic
  merge-recur: Remove dead code
  merge-recur: Get rid of debug code
  merge-recur: Convert variable names to lower_case
  Cumulative update of merge-recursive in C
  recur vs recursive: help testing without touching too many stuff.
  ...

This is an evil merge that removes TEST script from the toplevel.
......@@ -62,6 +62,7 @@ git-merge-tree
git-merge-octopus
git-merge-one-file
git-merge-ours
git-merge-recur
git-merge-recursive
git-merge-resolve
git-merge-stupid
......
......@@ -196,6 +196,7 @@ PROGRAMS = \
git-upload-pack$X git-verify-pack$X \
git-pack-redundant$X git-var$X \
git-describe$X git-merge-tree$X git-blame$X git-imap-send$X \
git-merge-recur$X \
$(EXTRA_PROGRAMS)
# Empty...
......@@ -711,6 +712,11 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
merge-recursive.o path-list.o: path-list.h
git-merge-recur$X: merge-recursive.o path-list.o $(GITLIBS)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS)
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
$(DIFF_OBJS): diffcore.h
......@@ -870,7 +876,7 @@ check-docs::
do \
case "$$v" in \
git-merge-octopus | git-merge-ours | git-merge-recursive | \
git-merge-resolve | git-merge-stupid | \
git-merge-resolve | git-merge-stupid | git-merge-recur | \
git-ssh-pull | git-ssh-push ) continue ;; \
esac ; \
test -f "Documentation/$$v.txt" || \
......
......@@ -145,6 +145,7 @@ extern void verify_non_filename(const char *prefix, const char *name);
extern int read_cache(void);
extern int read_cache_from(const char *path);
extern int write_cache(int newfd, struct cache_entry **cache, int entries);
extern int discard_cache(void);
extern int verify_path(const char *path);
extern int cache_name_pos(const char *name, int namelen);
#define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */
......
......@@ -9,15 +9,20 @@ USAGE='[-n] [--no-commit] [--squash] [-s <strategy>]... <merge-message> <head> <
LF='
'
all_strategies='recursive octopus resolve stupid ours'
default_twohead_strategies='recursive'
all_strategies='recursive recur octopus resolve stupid ours'
case "${GIT_USE_RECUR_FOR_RECURSIVE}" in
'')
default_twohead_strategies=recursive ;;
?*)
default_twohead_strategies=recur ;;
esac
default_octopus_strategies='octopus'
no_trivial_merge_strategies='ours'
use_strategies=
index_merge=t
if test "@@NO_PYTHON@@"; then
all_strategies='resolve octopus stupid ours'
all_strategies='recur resolve octopus stupid ours'
default_twohead_strategies='resolve'
fi
......@@ -117,6 +122,10 @@ do
strategy="$2"
shift ;;
esac
case "$strategy,${GIT_USE_RECUR_FOR_RECURSIVE}" in
recursive,?*)
strategy=recur ;;
esac
case " $all_strategies " in
*" $strategy "*)
use_strategies="$use_strategies$strategy " ;;
......
......@@ -35,7 +35,13 @@ If you would prefer to skip this patch, instead run \"git rebase --skip\".
To restore the original branch and stop rebasing run \"git rebase --abort\".
"
unset newbase
strategy=recursive
case "${GIT_USE_RECUR_FOR_RECURSIVE}" in
'')
strategy=recursive ;;
?*)
strategy=recur ;;
esac
do_merge=
dotest=$GIT_DIR/.dotest-merge
prec=4
......@@ -200,6 +206,11 @@ do
shift
done
case "$strategy,${GIT_USE_RECUR_FOR_RECURSIVE}" in
recursive,?*)
strategy=recur ;;
esac
# Make sure we do not have .dotest
if test -z "$do_merge"
then
......
此差异已折叠。
......@@ -842,6 +842,23 @@ int read_cache_from(const char *path)
die("index file corrupt");
}
int discard_cache()
{
int ret;
active_nr = active_cache_changed = 0;
index_file_timestamp = 0;
cache_tree_free(&active_cache_tree);
if (cache_mmap == NULL)
return 0;
ret = munmap(cache_mmap, cache_mmap_size);
cache_mmap = NULL;
cache_mmap_size = 0;
/* no need to throw away allocated active_cache */
return ret;
}
#define WRITE_BUFFER_SIZE 8192
static unsigned char write_buffer[WRITE_BUFFER_SIZE];
static unsigned long write_buffer_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册