Commits

Author Commit Message Labels Comments Date
Junio C Hamano
apply: --3way with add/add conflict When a patch wants to create a path, but we already have it in our current state, pretend as if the patch and we independently added the same path and cause add/add conflict, so that the user can resolve it just like "git merge" in the same situation. For that purpose, implement load_current() in terms of the load_patch_target() helper introduced earlier to read the current contents from the path…
Junio C Hamano
apply: move verify_index_match() higher We will be adding another caller of this function in a later patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano
apply: plug the three-way merge logic in 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 …
Junio C Hamano
apply: fall back on three-way merge 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>
Junio C Hamano
apply: accept -3/--3way command line option 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>
Junio C Hamano
apply: move "already exists" logic to check_to_create() 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>
Junio C Hamano
apply: move check_to_create_blob() closer to its sole caller Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano
apply: further split load_preimage() 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>
Junio C Hamano
apply: refactor "previous patch" logic 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>
Junio C Hamano
apply: split load_preimage() helper function out 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>
Junio C Hamano
apply: factor out checkout_target() helper function 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>
Junio C Hamano
apply: refactor read_file_or_gitlink() 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>
Junio C Hamano
apply: clear_image() clears things a bit more 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, …
Junio C Hamano
apply: a bit more comments on PATH_TO_BE_DELETED 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>
Junio C Hamano
apply: fix an incomplete comment in check_patch() 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>
Alex Riesen
Restore umasks influence on the permissions of work tree created by clone The original version of the git-clone just used mkdir(1) to create the working directories. The version rewritten in C creates all directories inside the working tree by using the mode argument of 0777 when calling mkdir(2) to let the umask take effect. But the top-level directory of the working tree is created by passing the mode argument of 0755 to mkdir(2), which results in an overly tight re…
Chris Webb
Allow edit of empty message with commit --amend "git commit --amend" used on a commit with an empty message fails unless -m is given, whether or not --allow-empty-message is specified. Allow it to proceed to the editor with an empty commit message. Unless --allow-empty-message is in force, it will still abort later if an empty message is saved from the editor (this check was already necessary to prevent a non-empty commit message being edited …
Junio C Hamano
Merge git://github.com/git-l10n/git-po Translation updates for various languages. * git://github.com/git-l10n/git-po: l10n: zh_CN.po: translate 29 new messages l10n: de.po: translate 29 new messages Update Swedish translation (1095t0f0u) l10n: Update translation for Vietnamese l10n: Update git.pot (29 new messages)
Junio C Hamano
Fifth batch for 1.7.12 Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano
Merge branch 'cw/help-over-network' "git help -w $cmd" can show HTML version of documentation for "git-$cmd" by setting help.htmlpath to somewhere other than the default location where the build procedure installs them locally; the variable can even point at a http:// URL. * cw/help-over-network: Allow help.htmlpath to be a URL prefix Add config variable to set HTML path for git-help --web
Junio C Hamano
Merge branch 'mz/empty-rebase-test' We did not have test to make sure "git rebase" without extra options filters out an empty commit in the original history. * mz/empty-rebase-test: add test case for rebase of empty commit
Junio C Hamano
Merge branch 'pw/git-p4-tests' More "git p4" tests. * pw/git-p4-tests: git p4 test: fix badp4dir test git p4 test: split up big t9800 test git p4 test: cleanup_git should make a new $git git p4 test: copy source indeterminate git p4 test: check for error message in failed test git p4 test: rename some "git-p4 command" strings git p4 test: never create default test repo git p4 test: simplify quoting involving TR…
Junio C Hamano
Merge branch 'js/fast-export-paths-with-spaces' "git fast-export" produced an input stream for fast-import without properly quoting pathnames when they contain SPs in them. * js/fast-export-paths-with-spaces: fast-export: quote paths with spaces
Junio C Hamano
Merge branch 'cw/no-detaching-an-unborn' "git checkout --detach", when you are still on an unborn branch, should be forbidden, but it wasn't. * cw/no-detaching-an-unborn: git-checkout: disallow --detach on unborn branch
Junio C Hamano
Merge branch 'vr/use-our-perl-in-tests' Some implementations of Perl terminates "lines" with CRLF even when the script is operating on just a sequence of bytes. Make sure to use "$PERL_PATH", the version of Perl the user told Git to use, in our tests to avoid unnecessary breakages in tests. * vr/use-our-perl-in-tests: t/README: add a bit more Don'ts tests: enclose $PERL_PATH in double quotes t/test-lib.sh: export PERL_PATH for u…
Junio C Hamano
Merge branch 'mm/credential-plumbing' Expose the credential API to scripted Porcelain writers. * mm/credential-plumbing: git-remote-mediawiki: update comments to reflect credential support git-remote-mediawiki: add credential support git credential fill: output the whole 'struct credential' add 'git credential' plumbing command
Junio C Hamano
Merge branch 'jc/maint-blame-unique-abbrev' "git blame" did not try to make sure the abbreviated commit object names in its output are unique. * jc/maint-blame-unique-abbrev: blame: compute abbreviation width that ensures uniqueness
Junio C Hamano
Merge branch 'jn/perl-makemaker-leading-paths' * jn/perl-makemaker-leading-paths: perl/Makefile: Fix a missing double-quote perl/Makefile: move "mkdir -p" to module installation loop for maintainability
Junio C Hamano
Merge branch 'rj/platform-pread-may-be-thread-unsafe' On Cygwin, the platform pread(3) is not thread safe, just like our own compat/ emulation, and cannot be used in the index-pack program. * rj/platform-pread-may-be-thread-unsafe: index-pack: Disable threading on cygwin
Junio C Hamano
Merge branch 'mm/config-xdg' Teach git to read various information from $XDG_CONFIG_HOME/git/ to allow the user to avoid cluttering $HOME. * mm/config-xdg: config: write to $XDG_CONFIG_HOME/git/config file when appropriate Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore config: read (but not write) from $XDG_CONFIG_HOME/git/config file
  1. Prev
  2. Next