From: Junio C Hamano Date: Sun, 24 Aug 2008 21:48:36 +0000 (-0700) Subject: Merge branch 'maint' to sync with 1.6.0.1 X-Git-Tag: v1.6.1-rc1~308 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/49d3536594e653717844d53825fa7c0a494888f7?ds=inline;hp=-c Merge branch 'maint' to sync with 1.6.0.1 --- 49d3536594e653717844d53825fa7c0a494888f7 diff --combined Documentation/config.txt index 9020675866,81f981509a..af57d94304 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -358,8 -358,13 +358,13 @@@ core.editor: `EDITOR` environment variables and then finally `vi`. core.pager:: - The command that git will use to paginate output. Can be overridden - with the `GIT_PAGER` environment variable. + The command that git will use to paginate output. Can + be overridden with the `GIT_PAGER` environment + variable. Note that git sets the `LESS` environment + variable to `FRSX` if it is unset when it runs the + pager. One can change these settings by setting the + `LESS` variable to some other value or by giving the + `core.pager` option a value such as "`less -+FRSX`". core.whitespace:: A comma separated list of common whitespace problems to @@@ -567,10 -572,6 +572,10 @@@ diff.autorefreshindex: affects only 'git-diff' Porcelain, and not lower level 'diff' commands, such as 'git-diff-files'. +diff.suppress-blank-empty:: + A boolean to inhibit the standard behavior of printing a space + before each empty output line. Defaults to false. + diff.external:: If this config variable is set, diff generation is not performed using the internal diff machinery, but using the @@@ -983,9 -984,11 +988,11 @@@ pack.packSizeLimit: linkgit:git-repack[1]. pager.:: - Allows to set your own pager preferences for each command, overriding - the default. If `\--pager` or `\--no-pager` is specified on the command - line, it takes precedence over this option. + Allows turning on or off pagination of the output of a + particular git subcommand when writing to a tty. If + `\--paginate` or `\--no-pager` is specified on the command line, + it takes precedence over this option. To disable pagination for + all commands, set `core.pager` or 'GIT_PAGER' to "`cat`". pull.octopus:: The default merge strategy to use when pulling multiple branches diff --combined Documentation/git.txt index 1bc295dd54,363a785452..e178fb5813 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@@ -43,9 -43,9 +43,10 @@@ unreleased) version of git, that is ava branch of the `git.git` repository. Documentation for older releases are available here: --* link:v1.6.0/git.html[documentation for release 1.6.0] ++* link:v1.6.1/git.html[documentation for release 1.6.1] * release notes for ++ link:RelNotes-1.6.1.txt[1.6.1], link:RelNotes-1.6.0.txt[1.6.0]. * link:v1.5.6.5/git.html[documentation for release 1.5.6.5] @@@ -497,7 -497,8 +498,8 @@@ othe 'GIT_PAGER':: This environment variable overrides `$PAGER`. If it is set to an empty string or to the value "cat", git will not launch - a pager. + a pager. See also the `core.pager` option in + linkgit:git-config[1]. 'GIT_SSH':: If this environment variable is set then 'git-fetch' diff --combined Makefile index 5e944d8a16,2cef0187d1..e5a4985a1d --- a/Makefile +++ b/Makefile @@@ -124,9 -124,6 +124,9 @@@ all: # Define USE_STDEV below if you want git to care about the underlying device # change being considered an inode change from the update-index perspective. # +# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks +# field that counts the on-disk footprint in 512-byte blocks. +# # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8 # # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72. @@@ -578,11 -575,9 +578,11 @@@ EXTLIBS ifeq ($(uname_S),Linux) NO_STRLCPY = YesPlease + THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),GNU/kFreeBSD) NO_STRLCPY = YesPlease + THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),UnixWare) CC = cc @@@ -680,7 -675,6 +680,7 @@@ ifeq ($(uname_S),FreeBSD BASIC_CFLAGS += -I/usr/local/include BASIC_LDFLAGS += -L/usr/local/lib DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease + THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),OpenBSD) NO_STRCASESTR = YesPlease @@@ -688,7 -682,6 +688,7 @@@ NEEDS_LIBICONV = YesPlease BASIC_CFLAGS += -I/usr/local/include BASIC_LDFLAGS += -L/usr/local/lib + THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),NetBSD) ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) @@@ -697,7 -690,6 +697,7 @@@ BASIC_CFLAGS += -I/usr/pkg/include BASIC_LDFLAGS += -L/usr/pkg/lib ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib + THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),AIX) NO_STRCASESTR=YesPlease @@@ -735,6 -727,7 +735,7 @@@ ifeq ($(uname_S),HP-UX NO_UNSETENV = YesPlease NO_HSTRERROR = YesPlease NO_SYS_SELECT_H = YesPlease + SNPRINTF_RETURNS_BOGUS = YesPlease endif ifneq (,$(findstring MINGW,$(uname_S))) NO_MMAP = YesPlease @@@ -757,7 -750,6 +758,7 @@@ NO_SVN_TESTS = YesPlease NO_PERL_MAKEMAKER = YesPlease NO_POSIX_ONLY_PROGRAMS = YesPlease + NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1 COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" @@@ -872,9 -864,6 +873,9 @@@ endi ifdef NO_D_INO_IN_DIRENT BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT endif +ifdef NO_ST_BLOCKS_IN_STRUCT_STAT + BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT +endif ifdef NO_C99_FORMAT BASIC_CFLAGS += -DNO_C99_FORMAT endif @@@ -1227,9 -1216,7 +1228,9 @@@ endi git-%$X: %.o $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) -git-imap-send$X: imap-send.o $(LIB_FILE) +git-imap-send$X: imap-send.o $(GITLIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) http.o http-walker.o http-push.o transport.o: http.h diff --combined builtin-merge.c index 7759a0b1e9,b280444e10..0bff26e833 --- a/builtin-merge.c +++ b/builtin-merge.c @@@ -564,8 -564,6 +564,6 @@@ static int checkout_fast_forward(unsign struct dir_struct dir; struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file)); - if (read_cache_unmerged()) - die("you need to resolve your current index first"); refresh_cache(REFRESH_QUIET); fd = hold_locked_index(lock_file, 1); @@@ -651,13 -649,15 +649,15 @@@ static void add_strategies(const char * static int merge_trivial(void) { unsigned char result_tree[20], result_commit[20]; - struct commit_list parent; + struct commit_list *parent = xmalloc(sizeof(struct commit_list *)); write_tree_trivial(result_tree); printf("Wonderful.\n"); - parent.item = remoteheads->item; - parent.next = NULL; - commit_tree(merge_msg.buf, result_tree, &parent, result_commit); + parent->item = lookup_commit(head); + parent->next = xmalloc(sizeof(struct commit_list *)); + parent->next->item = remoteheads->item; + parent->next->next = NULL; + commit_tree(merge_msg.buf, result_tree, parent, result_commit); finish(result_commit, "In-index merge"); drop_save(); return 0; @@@ -743,6 -743,7 +743,7 @@@ static int evaluate_result(void int cnt = 0; struct rev_info rev; + discard_cache(); if (read_cache() < 0) die("failed to read the cache"); @@@ -776,7 -777,7 +777,7 @@@ int cmd_merge(int argc, const char **ar struct commit_list **remotes = &remoteheads; setup_work_tree(); - if (unmerged_cache()) + if (read_cache_unmerged()) die("You are in the middle of a conflicted merge."); /* @@@ -833,11 -834,6 +834,11 @@@ if (argc != 1) die("Can merge only exactly one commit into " "empty head"); + if (squash) + die("Squash commit into empty head not supported yet"); + if (!allow_fast_forward) + die("Non-fast-forward commit does not make sense into " + "an empty head"); remote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT); if (!remote_head) die("%s - not something we can merge", argv[0]); @@@ -1078,6 -1074,7 +1079,7 @@@ } /* Automerge succeeded. */ + discard_cache(); write_tree_trivial(result_tree); automerge_was_ok = 1; break; diff --combined combine-diff.c index 31ec0c5165,4dfc330867..0cf2a830b5 --- a/combine-diff.c +++ b/combine-diff.c @@@ -143,6 -143,8 +143,6 @@@ static void append_lost(struct sline *s } struct combine_diff_state { - struct xdiff_emit_state xm; - unsigned int lno; int ob, on, nb, nn; unsigned long nmask; @@@ -215,15 -217,17 +215,15 @@@ static void combine_diff(const unsigne parent_file.size = sz; xpp.flags = XDF_NEED_MINIMAL; memset(&xecfg, 0, sizeof(xecfg)); - ecb.outf = xdiff_outf; - ecb.priv = &state; memset(&state, 0, sizeof(state)); - state.xm.consume = consume_line; state.nmask = nmask; state.sline = sline; state.lno = 1; state.num_parent = num_parent; state.n = n; - xdi_diff(&parent_file, result_file, &xpp, &xecfg, &ecb); + xdi_diff_outf(&parent_file, result_file, consume_line, &state, + &xpp, &xecfg, &ecb); free(parent_file.ptr); /* Assign line numbers for this parent. @@@ -723,6 -727,18 +723,18 @@@ static void show_patch_diff(struct comb die("early EOF '%s'", elem->path); result[len] = 0; + + /* If not a fake symlink, apply filters, e.g. autocrlf */ + if (is_file) { + struct strbuf buf; + + strbuf_init(&buf, 0); + if (convert_to_git(elem->path, result, len, &buf, safe_crlf)) { + free(result); + result = strbuf_detach(&buf, &len); + result_size = len; + } + } } else { deleted_file: diff --combined t/t4015-diff-whitespace.sh index f9eb67d835,b1cbd36d17..fc2307eaa3 --- a/t/t4015-diff-whitespace.sh +++ b/t/t4015-diff-whitespace.sh @@@ -7,7 -7,7 +7,7 @@@ test_description='Test special whitespa ' . ./test-lib.sh -. ../diff-lib.sh +. "$TEST_DIRECTORY"/diff-lib.sh # Ray Lehtiniemi's example @@@ -352,4 -352,20 +352,20 @@@ test_expect_success 'checkdiff allows n git diff --check ' + test_expect_success 'combined diff with autocrlf conversion' ' + + git reset --hard && + echo >x hello && + git commit -m "one side" x && + git checkout HEAD^ && + echo >x goodbye && + git commit -m "the other side" x && + git config core.autocrlf true && + test_must_fail git merge master && + + git diff | sed -e "1,/^@@@/d" >actual && + ! grep "^-" actual + + ' + test_done