summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-09apply: plug the three-way merge logic inLibravatar Junio C Hamano1-3/+50
When a patch does not apply to what we have, but we know the preimage the patch was made against, we apply the patch to the preimage to compute what the patch author wanted the result to look like, and attempt a three-way merge between the result and our version, using the intended preimage as the base version. When we are applying the patch using the index, we would additionally need to add the object names of these three blobs involved in the merge, which is not yet done in this step, but we add a field to "struct patch" so that later write-out step can use it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: fall back on three-way mergeLibravatar Junio C Hamano1-1/+45
Grab the preimage blob the patch claims to be based on out of the object store, apply the patch, and then call three-way-merge function. This step still does not plug the actual three-way merge logic yet, but we are getting there. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: accept -3/--3way command line optionLibravatar Junio C Hamano2-2/+31
Begin teaching the three-way merge fallback logic "git am -3" uses to the underlying "git apply". It only implements the command line parsing part, and does not do anything interesting yet, other than making sure that "--reject" and "--3way" are not given together, and making "--3way" imply "--index". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: move "already exists" logic to check_to_create()Libravatar Junio C Hamano1-11/+29
The check_to_create_blob() function used to check only the case where we are applying to the working tree. Rename the function to check_to_create() and make it also responsible for checking the case where we apply to the index. Also make its caller responsible for issuing an error message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: move check_to_create_blob() closer to its sole callerLibravatar Junio C Hamano1-23/+23
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: further split load_preimage()Libravatar Junio C Hamano1-19/+40
load_preimage() is very specific to grab the current contents for the path given by patch->old_name. Split the logic that grabs the contents for a path out of it into a separate load_patch_target() function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: refactor "previous patch" logicLibravatar Junio C Hamano1-26/+56
The code to grab the result of application of a previous patch in the input was mixed with error message generation for a case where a later patch tries to modify contents of a path that has been removed. The same code is duplicated elsewhere in the code. Introduce a helper to clarify what is going on. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: split load_preimage() helper function outLibravatar Junio C Hamano1-3/+12
Given a patch for a single path, the function apply_data() reads the preimage in core, and applies the change represented in the patch. Separate out the first part that reads the preimage into a separate helper function load_preimage(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: factor out checkout_target() helper functionLibravatar Junio C Hamano1-7/+13
When a patch wants to touch a path, if the path exists in the index but is missing in the working tree, "git apply --index" checks out the file to the working tree from the index automatically and then applies the patch. Split this logic out to a separate helper function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: refactor read_file_or_gitlink()Libravatar Junio C Hamano1-7/+11
Reading a blob out of the object store does not have to require that the caller has a cache entry for it. Create a read_blob_object() helper function that takes the object name and mode, and use it to reimplement the original function as a thin wrapper to it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: clear_image() clears things a bit moreLibravatar Junio C Hamano1-2/+2
The clear_image() function did not clear the line table in the image structure; this does not matter for the current callers, as the function is only called from the codepaths that deal with binary patches where the line table is never populated, and the codepaths that do populate the line table free it themselves. But it will start to matter when we introduce a codepath to retry a failed patch, so make sure it clears and frees everything. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: a bit more comments on PATH_TO_BE_DELETEDLibravatar Junio C Hamano1-2/+8
The code is littered with to_be_deleted() whose purpose is not so clear. Describe where it matters. Also remove an extra space before "#define" that snuck in by mistake at 7fac0ee (builtin-apply: keep information about files to be deleted, 2009-04-11). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: fix an incomplete comment in check_patch()Libravatar Junio C Hamano1-9/+15
This check is not only about type-change (for which it would be sufficient to check only was_deleted()) but is also about a swap rename. Otherwise to_be_deleted() check is not justified. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-07The ninth batch of topics graduated to 'master'Libravatar Junio C Hamano1-50/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-07Merge branch 'nh/empty-rebase'Libravatar Junio C Hamano1-3/+11
By Neil Horman * nh/empty-rebase: git cherry-pick: do not dereference a potential NULL pointer
2012-05-07Merge branch 'zj/diff-empty-chmod'Libravatar Junio C Hamano2-34/+74
"git diff --stat" used to fully count a binary file with modified execution bits whose contents is unmodified, which was not right. By Zbigniew Jędrzejewski-Szmek (4) and Johannes Sixt (1) * zj/diff-empty-chmod: t4006: Windows do not have /dev/zero diff --stat: do not run diff on indentical files diff --stat: report mode-only changes for binary files like text files tests: check --[short]stat output after chmod test: modernize style of t4006 Conflicts: diff.c
2012-05-07Merge branch 'jk/maint-tformat-with-z'Libravatar Junio C Hamano2-1/+29
"log -z --pretty=tformat:..." does not terminate each record with NUL and this is a beginning of an attempt to fix it. It still is not right but the patch does not make externally observable behaviour worse. By Jan Krüger (1) and Junio C Hamano (1) * jk/maint-tformat-with-z: log-tree: the previous one is still not quite right log-tree: use custom line terminator in line termination mode
2012-05-07Merge branch 'th/difftool-diffall'Libravatar Junio C Hamano4-87/+398
Rolls the two-directory-diff logic from diffall script (in contrib/) into "git difftool" framework. By Tim Henigan * th/difftool-diffall: difftool: print list of valid tools with '--tool-help' difftool: teach difftool to handle directory diffs difftool: eliminate setup_environment function difftool: stop appending '.exe' to git difftool: remove explicit change of PATH difftool: exit(0) when usage is printed difftool: add '--no-gui' option difftool: parse options using Getopt::Long
2012-05-07Sync with maintLibravatar Junio C Hamano2-2/+49
2012-05-07Start preparing for 1.7.10.2Libravatar Junio C Hamano2-1/+47
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-07Merge branch 'jk/maint-gitweb-test-use-sane-perl' into maintLibravatar Junio C Hamano3-3/+3
When using a Perl script on a system where "perl" found on user's $PATH could be ancient or otherwise broken, we allow builders to specify the path to a good copy of Perl with $PERL_PATH. The gitweb test forgot to use that Perl when running its test. By Jeff King (1) and Zbigniew Jędrzejewski-Szmek (1) * jk/maint-gitweb-test-use-sane-perl: Consistently use perl from /usr/bin/ for scripts t/gitweb-lib: use $PERL_PATH to run gitweb
2012-05-07Merge branch 'js/daemon-test-race-fix' into maintLibravatar Junio C Hamano1-11/+11
The test scaffolding for git-daemon was flaky. By Johannes Sixt * js/daemon-test-race-fix: t5570: fix forwarding of git-daemon messages via cat
2012-05-07Merge branch 'jk/maint-config-bogus-section' into maintLibravatar Junio C Hamano2-1/+31
"git config --rename-section" to rename an existing section into a bogus one did not check the new name. By Jeff King * jk/maint-config-bogus-section: config: reject bogus section names for --rename-section
2012-05-07Merge branch 'pw/t5800-import-race-fix' into maintLibravatar Junio C Hamano2-0/+20
The test scaffolding for fast-import was flaky. By Pete Wyckoff * pw/t5800-import-race-fix: git-remote-testgit: fix race when spawning fast-import
2012-05-07Merge branch 'rt/cherry-revert-conflict-summary' into maintLibravatar Junio C Hamano1-1/+1
In the older days, the header "Conflicts:" in "cherry-pick" and "merge" was separated by a blank line from the list of paths that follow for readability, but when "merge" was rewritten in C, we lost it by mistake. Remove the newline from "cherry-pick" to make them match again. By Ralf Thielow * rt/cherry-revert-conflict-summary: sequencer: remove additional blank line
2012-05-07Merge branch 'cb/maint-report-mount-point-correctly-in-setup' into maintLibravatar Junio C Hamano1-9/+13
The filesystem boundary was not correctly reported when .git directory discovery stopped at a mount point. By Clemens Buchacher * cb/maint-report-mount-point-correctly-in-setup: properly keep track of current working directory
2012-05-07git p4 doc: fix formattingLibravatar Pete Wyckoff1-1/+3
Attach example sections to previous level of indenting. Fix a trailing :: Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-04Makefile: keep many variable list sortedLibravatar Nguyễn Thái Ngọc Duy1-13/+13
We tend to keep long lists sorted (extensions are not taken into account), which helps spot a name easily by eye. Rearrange a few items so these lists remain sorted. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-03git cherry-pick: do not dereference a potential NULL pointerLibravatar Neil Horman1-3/+11
In the case the pointer could be NULL, the function that gave the caller the NULL pointer would already have issued an error message, so simply returning early with an error status without issuing a new message is sufficient. The same for parse_commit() that will show necessary error message when the argument is not NULL, and will return error silently when the argument is NULL. Noticed-by: Michael Mueller Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-03Merge branch 'maint'Libravatar Junio C Hamano0-0/+0
* maint:
2012-05-03Merge branch 'jc/merge-reduce-parents-early' into maintLibravatar Junio C Hamano5-71/+276
Octopus merge strategy did not reduce heads that are recorded in the final commit correctly. By Junio C Hamano (4) and Michał Kiedrowicz (1) * jc/merge-reduce-parents-early: fmt-merge-msg: discard needless merge parents builtin/merge.c: reduce parents early builtin/merge.c: collect other parents early builtin/merge.c: remove "remoteheads" global variable merge tests: octopus with redundant parents
2012-05-03Merge branch 'cb/cherry-pick-rev-path-confusion' into maintLibravatar Junio C Hamano3-11/+19
The command line parser choked "git cherry-pick $name" when $name can be both revision name and a pathname, even though $name can never be a path in the context of the command. By Clemens Buchacher * cb/cherry-pick-rev-path-confusion: cherry-pick: do not expect file arguments
2012-05-03Merge branch 'cb/http-multi-curl-auth' into maintLibravatar Junio C Hamano2-10/+26
HTTP transport that requires authentication did not work correctly when multiple connections are used simultaneously. By Jeff King (3) and Clemens Buchacher (1) * cb/http-multi-curl-auth: http: use newer curl options for setting credentials http: clean up leak in init_curl_http_auth fix http auth with multiple curl handles http auth fails with multiple curl handles
2012-05-03Merge branch 'mb/fetch-call-a-non-branch-a-ref' into maintLibravatar Junio C Hamano2-4/+43
The report from "git fetch" said "new branch" even for a non branch ref. By Marc Branchaud * mb/fetch-call-a-non-branch-a-ref: fetch: describe new refs based on where it came from fetch: Give remote_ref to update_local_ref() as well
2012-05-03Merge branch 'rl/maint-stash-i18n-save-error' into maintLibravatar Junio C Hamano1-2/+2
i18n marking for an error message for "git stash --notavalidoption" was incorrect. By Ross Lagerwall * rl/maint-stash-i18n-save-error: stash: use eval_gettextln correctly
2012-05-03Merge branch 'jm/maint-strncpy-diff-no-index' into maintLibravatar Junio C Hamano1-21/+17
"diff --no-index" codepath had a few places that used fixed-size buffer and truncated paths that are too long. By Jim Meyering (1) and Junio C Hamano (1) * jm/maint-strncpy-diff-no-index: diff --no-index: use strbuf for temporary pathnames diff: avoid stack-buffer-read-overrun for very long name
2012-05-03Merge branch 'jk/maint-push-progress'Libravatar Junio C Hamano3-2/+39
"git push" over smart-http lost progress output and this resurrects it. By Jeff King * jk/maint-push-progress: t5541: test more combinations of --progress teach send-pack about --[no-]progress send-pack: show progress when isatty(2)
2012-05-03Merge branch 'nd/columns'Libravatar Junio C Hamano27-48/+1105
A couple of commands learn --column option to produce columnar output. By Nguyễn Thái Ngọc Duy (9) and Zbigniew Jędrzejewski-Szmek (1) * nd/columns: tag: add --column column: support piping stdout to external git-column process status: add --column branch: add --column help: reuse print_columns() for help -a column: add dense layout support t9002: work around shells that are unable to set COLUMNS to 1 column: add columnar layout Stop starting pager recursively Add column layout skeleton and git-column
2012-05-03doc/config: fix inline literalsLibravatar Jeff King1-2/+2
Since commit 6cf378f, asciidoc backticks are now inline literals; therefore quoting {tilde} inside them is wrong (this instance was missed in 6cf378f because it happened on a parallel line of development). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-02The eighth batch of topics graduated to 'master'Libravatar Junio C Hamano1-32/+42
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-02Merge branch 'master' of git://git.bogomips.org/git-svnLibravatar Junio C Hamano1-7/+25
via Eric Wong * 'master' of git://git.bogomips.org/git-svn: git-svn: introduce SVN version comparison function
2012-05-02Merge branch 'tr/xdiff-fast-hash'Libravatar Junio C Hamano2-0/+118
Use word-at-a-time comparison to find end of line or NUL (end of buffer), borrowed from the linux-kernel discussion. By Thomas Rast * tr/xdiff-fast-hash: xdiff: choose XDL_FAST_HASH code on sizeof(long) instead of __WORDSIZE xdiff: load full words in the inner loop of xdl_hash_record
2012-05-02Merge branch 'jk/maint-gitweb-test-use-sane-perl'Libravatar Junio C Hamano3-3/+3
When using a Perl script on a system where "perl" found on user's $PATH could be ancient or otherwise broken, we allow builders to specify the path to a good copy of Perl with $PERL_PATH. The gitweb test forgot to use that Perl when running its test. By Jeff King (1) and Zbigniew Jędrzejewski-Szmek (1) * jk/maint-gitweb-test-use-sane-perl: Consistently use perl from /usr/bin/ for scripts t/gitweb-lib: use $PERL_PATH to run gitweb
2012-05-02Merge branch 'pw/message-cleanup'Libravatar Junio C Hamano15-24/+24
Many error/warning messages had extra trailing newlines that are unnecessary. By Pete Wyckoff * pw/message-cleanup: remove blank filename in error message remove superfluous newlines in error messages
2012-05-02Merge branch 'zj/diff-stat-smaller-num-columns'Libravatar Junio C Hamano77-353/+400
Spend only minimum number of columns necessary to show the number of lines in the output from "diff --stat", instead of always allocating 4 columns even when showing changes that are much smaller than 1000 lines. By Zbigniew Jędrzejewski-Szmek * zj/diff-stat-smaller-num-columns: diff --stat: use less columns for change counts
2012-05-02Merge branch 'pw/p4-various'Libravatar Junio C Hamano4-35/+308
Miscellaneous updates to "git p4". By Pete Wyckoff * pw/p4-various: git p4: submit files with wildcards git p4: fix writable file after rename or copy git p4: test submit git p4: bring back files in deleted client directory
2012-05-02Merge branch 'jc/rerere-train'Libravatar Junio C Hamano1-1/+1
A script written long time ago proved to be useful this week for me ;-) with a minor tweak. * jc/rerere-train: contrib/rerere-train: use installed git-sh-setup
2012-05-02Merge branch 'ab/i18n'Libravatar Junio C Hamano2-45/+44
Fix some constructs that build messages meant for i18n by concatenating pieces of strings. By Ævar Arnfjörð Bjarmason * ab/i18n: git-commit: remove lego in i18n messages git-commit: remove lego in i18n messages git-branch: remove lego in i18n messages
2012-05-02Merge branch 'lp/diffstat-with-graph'Libravatar Junio C Hamano4-6/+130
"log --graph" was not very friendly with "--stat" option and its output had line breaks at wrong places. By Lucian Poston (5) and Zbigniew Jędrzejewski-Szmek (2) * lp/diffstat-with-graph: t4052: work around shells unable to set COLUMNS to 1 Prevent graph_width of stat width from falling below min t4052: Test diff-stat output with minimum columns t4052: Adjust --graph --stat output for prefixes Adjust stat width calculations to take --graph output into account Add output_prefix_length to diff_options t4052: test --stat output with --graph
2012-05-02Merge branch 'zj/mksh-columns-breakage'Libravatar Junio C Hamano1-0/+1
A broken shell may not let us set an environment value to an arbitrary value, interfering with some of the tests. Introduce a test prerequisite so that we can skip some tests on such a platform. By Zbigniew Jędrzejewski-Szmek * zj/mksh-columns-breakage: test-lib: skip test with COLUMNS=1 under mksh