summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* log --show-signature: reword the common two-head merge casejc/show-sigJunio C Hamano2012-01-051-0/+12
| | | | | | | | | | | | | While identifying the commit merged to our history as "parent #2" is technically correct, we will never say "parent #1" (as that is the tip of our history before the merge is made), and we rarely would say "parent #3" (which would mean the merge is an octopus), especially when responding to a request to pull a signed tag. Treat the most common case to merge a single commit specially, and just say "merged tag '<tagname>'" instead. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* log-tree: show mergetag in log --show-signature outputJunio C Hamano2012-01-051-1/+75
| | | | | | | | A commit object that merges a signed tag records the "mergetag" extended header. Check the validity of the GPG signature on it, and show it in a way similar to how "gpgsig" extended header is shown. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* log-tree.c: small refactor in show_signature()Junio C Hamano2012-01-051-12/+16
| | | | | | | | | | The next patch needs to show the result of signature verification on a mergetag extended header in a way similar to how embedded signature for the commit object itself is shown. Separate out the logic to go through the message lines and show them in the "error" color (highlighted) or the "correct" color (dim). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* commit --amend -S: strip existing gpgsig headersJunio C Hamano2012-01-054-8/+36
| | | | | | | | Any existing commit signature was made against the contents of the old commit, including its committer date that is about to change, and will become invalid by amending it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* verify_signed_buffer: fix stale commentJunio C Hamano2012-01-051-4/+1
| | | | | | | The function used to take an integer flag to specify where the output should go, but these days we supply a strbuf to receive it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jc/signed-commit' and 'jc/pull-signed-tag'Junio C Hamano2012-01-0515-19/+364
|\ | | | | | | | | | | | | | | They both use the extended headers in commit objects, and the former has necessary infrastructure to show them that is useful to view the result of the latter. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * gpg-interface: allow use of a custom GPG binaryjc/signed-commitJunio C Hamano2011-11-293-6/+24
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * pretty: %G[?GS] placeholdersJunio C Hamano2011-11-121-0/+86
| | | | | | | | | | | | | | | | | | | | Add new placeholders related to the GPG signature on signed commits. - %GG to show the raw verification message from GPG; - %G? to show either "G" for Good, "B" for Bad; - %GS to show the name of the signer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * test "commit -S" and "log --show-signature"Junio C Hamano2011-11-121-0/+71
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * log: --show-signatureJunio C Hamano2011-11-125-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | This teaches the "log" family of commands to pass the GPG signature in the commit objects to "gpg --verify" via the verify_signed_buffer() interface used to verify signed tag objects. E.g. $ git show --show-signature -s HEAD shows GPG output in the header part of the output. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * commit: teach --gpg-sign optionJunio C Hamano2011-11-127-13/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the gpg-interface.[ch] to allow signing the commit, i.e. $ git commit --gpg-sign -m foo You need a passphrase to unlock the secret key for user: "Junio C Hamano <gitster@pobox.com>" 4096-bit RSA key, ID 96AFE6CB, created 2011-10-03 (main key ID 713660A7) [master 8457d13] foo 1 files changed, 1 insertions(+), 0 deletions(-) The lines of GPG detached signature are placed in a new multi-line header field, instead of tucking the signature block at the end of the commit log message text (similar to how signed tag is done), for multiple reasons: - The signature won't clutter output from "git log" and friends if it is in the extra header. If we place it at the end of the log message, we would need to teach "git log" and friends to strip the signature block with an option. - Teaching new versions of "git log" and "gitk" to optionally verify and show signatures is cleaner if we structurally know where the signature block is (instead of scanning in the commit log message). - The signature needs to be stripped upon various commit rewriting operations, e.g. rebase, filter-branch, etc. They all already ignore unknown headers, but if we place signature in the log message, all of these tools (and third-party tools) also need to learn how a signature block would look like. - When we added the optional encoding header, all the tools (both in tree and third-party) that acts on the raw commit object should have been fixed to ignore headers they do not understand, so it is not like that new header would be more likely to break than extra text in the commit. A commit made with the above sample sequence would look like this: $ git cat-file commit HEAD tree 3cd71d90e3db4136e5260ab54599791c4f883b9d parent b87755351a47b09cb27d6913e6e0e17e6254a4d4 author Junio C Hamano <gitster@pobox.com> 1317862251 -0700 committer Junio C Hamano <gitster@pobox.com> 1317862251 -0700 gpgsig -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJOjPtrAAoJELC16IaWr+bL4TMP/RSe2Y/jYnCkds9unO5JEnfG ... =dt98 -----END PGP SIGNATURE----- foo but "git log" (unless you ask for it with --pretty=raw) output is not cluttered with the signature information. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | commit: do not lose mergetag header when not amendingJunio C Hamano2011-12-201-1/+5
|/ | | | | | | | | The earlier ed7a42a (commit: teach --amend to carry forward extra headers, 2011-11-08) broke "git merge/pull; edit to fix conflict; git commit" workflow by forgetting that commit_tree_extended() takes the whole extra header list. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* commit-tree: teach -m/-F options to read logs from elsewhereJunio C Hamano2011-11-122-6/+53
| | | | | | Just like "git commit" does. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* commit-tree: update the command line parsingJunio C Hamano2011-11-091-13/+18
| | | | | | | | | We have kept the original "git commit-tree <tree> -p <parent> ..." syntax forever, but "git commit-tree -p <parent> -p <parent> ... <tree>" would be more intuitive way to spell it. Dashed flags along with their arguments come first and then the "thing" argument after the flags. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* commit: teach --amend to carry forward extra headersJunio C Hamano2011-11-093-3/+76
| | | | | | | | | After running "git pull $there for-linus" to merge a signed tag, the integrator may need to amend the resulting merge commit to fix typoes in it. Teach --amend option to read the existing extra headers, and carry them forward. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* merge: force edit and no-ff mode when merging a tag objectJunio C Hamano2011-11-091-0/+6
| | | | | | | | | | Now that we allow pulling a tag from the remote site to validate the authenticity, we should give the user the final chance to verify and edit the merge message. The integrator is expected to leave a meaningful merge commit log in the history. Disallow fast-forwarding in such a case to ensure that a merge commit is always recorded. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* commit: copy merged signed tags to headers of merge commitJunio C Hamano2011-11-093-11/+116
| | | | | | | | | | | | | | | | | | Now MERGE_HEAD records the tag objects without peeling, we could record the result of manual conflict resolution via "git commit" without losing the tag information. Introduce a new "mergetag" multi-line header field to the commit object, and use it to store the entire contents of each signed tag merged. A commit header that has a multi-line payload begins with the header tag (e.g. "mergetag" in this case), SP, the first line of payload, LF, and all the remaining lines have a SP inserted at the beginning. In hindsight, it would have been better to make "merge --continue" as the way to continue from such an interrupted merge, not "commit", but this is a backward compatibility baggage we would need to carry around for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* merge: record tag objects without peeling in MERGE_HEADJunio C Hamano2011-11-082-4/+15
| | | | | | | | Otherwise, "git commit" wouldn't have a way to tell that we were in the middle of merging an annotated or signed tag, not a plain commit, after "git merge" stops to ask the user to resolve conflicts. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* merge: make usage of commit->util more extensibleJunio C Hamano2011-11-084-47/+61
| | | | | | | | | | | | | | | The merge-recursive code uses the commit->util field directly to annotate the commit objects given from the command line, i.e. the remote heads to be merged, with a single string to be used to describe it in its trace messages and conflict markers. Correct this short-signtedness by redefining the field to be a pointer to a structure "struct merge_remote_desc" that later enhancements can add more information. Store the original objects we were told to merge in a field "obj" in this struct, so that we can recover the tag we were told to merge. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fmt-merge-msg: Add contents of merged tag in the merge messageJunio C Hamano2011-11-083-2/+92
| | | | | | | | | | | | | | | | | | | | | | | | When a contributor asks the integrator to merge her history, a signed tag can be a good vehicle to communicate the authenticity of the request while conveying other information such as the purpose of the topic. E.g. a signed tag "for-linus" can be created, and the integrator can run: $ git pull git://example.com/work.git/ for-linus This would allow the integrator to run "git verify-tag FETCH_HEAD" to validate the signed tag. Update fmt-merge-msg so that it pre-fills the merge message template with the body (but not signature) of the tag object to help the integrator write a better merge message, in the same spirit as the existing merge.log summary lines. The message that comes from GPG signature validation is also included in the merge message template to help the integrator verify it, but they are prefixed with "#" to make them comments. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fmt-merge-msg: package options into a structureJunio C Hamano2011-11-073-18/+27
| | | | | | This way new features can be added more easily Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fmt-merge-msg: avoid early returnsJunio C Hamano2011-11-071-10/+10
| | | | | | | | In various places in the codepath, the program tries to return early assuming there is no more work needed. That is generally untrue when over time new features are added. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs DWIMmery: use the same rule for both "git fetch" and othersJunio C Hamano2011-11-073-12/+3
| | | | | | | | | | | | | | | | | | | | | | "git log frotz" can DWIM to "refs/remotes/frotz/HEAD", but in the remote access context, "git fetch frotz" to fetch what the other side happened to have fetched from what it calls 'frotz' (which may not have any relation to what we consider is 'frotz') the last time would not make much sense, so the fetch rules table did not include "refs/remotes/%.*s/HEAD". When the user really wants to, "git fetch $there remotes/frotz/HEAD" would let her do so anyway, so this is not about safety or security; it merely is about confusion avoidance and discouraging meaningless usage. Specifically, it is _not_ about ambiguity avoidance. A name that would become ambiguous if we use the same rules table for both fetch and local rev-parse would be ambiguous locally at the remote side. So for the same reason as we added rule to allow "git fetch $there v1.0" instead of "git fetch $there tags/v1.0" in the previous commit, here is a bit longer rope for the users, which incidentally simplifies our code. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fetch: allow "git fetch $there v1.0" to fetch a tagJunio C Hamano2011-11-071-0/+1
| | | | | | | You can already do so with "git fetch $there tags/v1.0" but if it is not ambiguous there is no reason to force users to type more. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* merge: notice local merging of tags and keep it unwrappedJunio C Hamano2011-11-075-8/+13
| | | | | | | This also updates the autogenerated merge title message from "merge commit X" to "merge tag X", and its effect can be seen in the changes to the test suite. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fetch: do not store peeled tag object names in FETCH_HEADLinus Torvalds2011-11-0459-176/+175
| | | | | | | | | | | | We do not want to record tags as parents of a merge when the user does "git pull $there tag v1.0" to merge tagged commit, but that is not a good enough excuse to peel the tag down to commit when storing in FETCH_HEAD. The caller of underlying "git fetch $there tag v1.0" may have other uses of information contained in v1.0 tag in mind. [jc: the test adjustment is to update for the new expectation] Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Split GPG interface into its own helper libraryJunio C Hamano2011-11-046-100/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | This mostly moves existing code from builtin/tag.c (for signing) and builtin/verify-tag.c (for verifying) to a new gpg-interface.c file to provide a more generic library interface. - sign_buffer() takes a payload strbuf, a signature strbuf, and a signing key, runs "gpg" to produce a detached signature for the payload, and appends it to the signature strbuf. The contents of a signed tag that concatenates the payload and the detached signature can be produced by giving the same strbuf as payload and signature strbuf. - verify_signed_buffer() takes a payload and a detached signature as <ptr, len> pairs, and runs "gpg --verify" to see if the payload matches the signature. It can optionally capture the output from GPG to allow the callers to pretty-print it in a way more suitable for their contexts. "verify-tag" (aka "tag -v") used to save the whole tag contents as if it is a detached signature, and fed gpg the payload part of the tag. It relied on gpg to fail when the given tag is not signed but just is annotated. The updated run_gpg_verify() function detects the lack of detached signature in the input, and errors out without bothering "gpg". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'js/merge-edit-option'Junio C Hamano2011-10-193-39/+99
|\ | | | | | | | | | | | | | | * js/merge-edit-option: Teach merge the '[-e|--edit]' option Conflicts: builtin/merge.c
| * Teach merge the '[-e|--edit]' optionJay Soffian2011-10-123-39/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented internally instead of as "git merge --no-commit && git commit" so that "merge --edit" is otherwise consistent (hooks, etc) with "merge". Note: the edit message does not include the status information that one gets with "commit --status" and it is cleaned up after editing like one gets with "commit --cleanup=default". A later patch could add the status information if desired. Note: previously we were not calling stripspace() after running the prepare-commit-msg hook. Now we are, stripping comments and leading/trailing whitespace lines if --edit is given, otherwise only stripping leading/trailing whitespace lines if not given --edit. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/diff-whole-function'Junio C Hamano2011-10-196-16/+175
|\ \ | | | | | | | | | | | | | | | * rs/diff-whole-function: diff: add option to show whole functions as context xdiff: factor out get_func_line()
| * | diff: add option to show whole functions as contextrs/diff-whole-functionRené Scharfe2011-10-106-6/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the option -W/--function-context to git diff. It is similar to the same option of git grep and expands the context of change hunks so that the whole surrounding function is shown. This "natural" context can allow changes to be understood better. Note: GNU patch doesn't like diffs generated with the new option; it seems to expect context lines to be the same before and after changes. git apply doesn't complain. This implementation has the same shortcoming as the one in grep, namely that there is no way to explicitly find the end of a function. That means that a few lines of extra context are shown, right up to the next recognized function begins. It's already useful in its current form, though. The function get_func_line() in xdiff/xemit.c is extended to work forward as well as backward to find post-context as well as pre-context. It returns the position of the first found matching line. The func_line parameter is made optional, as we don't need it for -W. The enhanced function is then used in xdl_emit_diff() to extend the context as needed. If the added context overlaps with the next change, it is merged into the current hunk. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | xdiff: factor out get_func_line()René Scharfe2011-10-101-16/+27
| |/ | | | | | | | | | | | | | | | | Move the code to search for a function line to be shown in the hunk header into its own function and to make returning the length-limited result string easier, introduce struct func_line. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/pickaxe'Junio C Hamano2011-10-191-108/+70
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rs/pickaxe: pickaxe: factor out pickaxe pickaxe: give diff_grep the same signature as has_changes pickaxe: pass diff_options to contains and has_changes pickaxe: factor out has_changes pickaxe: plug regex/kws leak pickaxe: plug regex leak pickaxe: plug diff filespec leak with empty needle
| * | pickaxe: factor out pickaxers/pickaxeRené Scharfe2011-10-071-67/+43
| | | | | | | | | | | | | | | | | | | | | | | | Move the duplicate diff queue loop into its own function that accepts a match function: has_changes() for -S and diff_grep() for -G. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | pickaxe: give diff_grep the same signature as has_changesRené Scharfe2011-10-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change diff_grep() to match the signature of has_changes() as a preparation for the next patch that will use function pointers to the two. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | pickaxe: pass diff_options to contains and has_changesRené Scharfe2011-10-071-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the unused parameter needle from contains() and has_changes(). Also replace the parameter len with a pointer to the diff_options. We can use its member pickaxe to check if the needle is an empty string and use the kwsmatch structure to find out the length of the match instead. This change is done as a preparation to unify the signatures of has_changes() and diff_grep(), which will be used in the patch after the next one to factor out common code. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | pickaxe: factor out has_changesRené Scharfe2011-10-071-36/+21
| | | | | | | | | | | | | | | | | | | | | Move duplicate if/else construct into its own helper function. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | pickaxe: plug regex/kws leakRené Scharfe2011-10-071-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | With -S... --pickaxe-all, free the regex or the kws before returning even if we found a match. Also get rid of the variable has_changes, as we can simply break out of the loop. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | pickaxe: plug regex leakRené Scharfe2011-10-071-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | With -G... --pickaxe-all, free the regex before returning even if we found a match. Also get rid of the variable has_changes, as we can simply break out of the loop. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | pickaxe: plug diff filespec leak with empty needleRené Scharfe2011-10-071-2/+2
| |/ | | | | | | | | | | | | | | Check first for the unlikely case of an empty needle string and only then populate the filespec, lest we leak it. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'js/no-cherry-pick-head-after-punted'Junio C Hamano2011-10-192-7/+31
|\ \ | | | | | | | | | | | | | | | * js/no-cherry-pick-head-after-punted: cherry-pick: do not give irrelevant advice when cherry-pick punted revert.c: defer writing CHERRY_PICK_HEAD till it is safe to do so
| * \ Merge branch 'js/maint-no-cherry-pick-head-after-punted' into ↵Junio C Hamano2011-10-062-7/+31
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | js/no-cherry-pick-head-after-punted * js/maint-no-cherry-pick-head-after-punted: cherry-pick: do not give irrelevant advice when cherry-pick punted revert.c: defer writing CHERRY_PICK_HEAD till it is safe to do so Conflicts: builtin/revert.c
| | * | cherry-pick: do not give irrelevant advice when cherry-pick puntedjs/maint-no-cherry-pick-head-after-puntedJay Soffian2011-10-061-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a cherry-pick did not even start because the working tree had local changes that would overlap with the operation, we shouldn't be advising the users to resolve conflicts nor to conclude it with "git commit". Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | * | revert.c: defer writing CHERRY_PICK_HEAD till it is safe to do soJay Soffian2011-10-062-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do_pick_commit() writes out CHERRY_PICK_HEAD before invoking merge (either via do_recursive_merge() or try_merge_command()) on the assumption that if the merge fails it is due to conflict. However, if the tree is dirty, the merge may not even start, aborting before do_pick_commit() can remove CHERRY_PICK_HEAD. Instead, defer writing CHERRY_PICK_HEAD till after merge has returned. At this point we know the merge has either succeeded or failed due to conflict. In either case, we want CHERRY_PICK_HEAD to be written so that it may be picked up by the subsequent invocation of commit. Note that do_recursive_merge() aborts if the merge cannot start, while try_merge_command() returns a non-zero value other than 1. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'bk/submodule-in-recursive-merge'Junio C Hamano2011-10-194-4/+61
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * bk/submodule-in-recursive-merge: submodule: Search for merges only at end of recursive merge submodule: Demonstrate known breakage during recursive merge
| * | | | submodule: Search for merges only at end of recursive mergeBrad King2011-10-134-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The submodule merge search is not useful during virtual merges because the results cannot be used automatically. Furthermore any suggestions made by the search may apply to commits different than HEAD:sub and MERGE_HEAD:sub, thus confusing the user. Skip searching for submodule merges during a virtual merge such as that between B and C while merging the heads of: B---BC / \ / A X \ / \ C---CB Run the search only when the recursion level is zero (!o->call_depth). This fixes known breakage tested in t7405-submodule-merge. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | submodule: Demonstrate known breakage during recursive mergeBrad King2011-10-131-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 68d03e4a (Implement automatic fast-forward merge for submodules, 2010-07-07) we try to suggest submodule commits that resolve a conflict. Consider a true recursive merge case b---bc / \ / o X \ / \ c---cb in which the two heads themselves (bc,cb) had resolved a submodule conflict (i.e. reference different commits than their parents). The submodule merge search runs during the temporary merge of the two merge bases (b,c) and prints out a suggestion that is not meaningful to the user. Then during the main merge the submodule merge search runs again but dies with the message fatal: --ancestry-path given but there are no bottom commits while trying to enumerate candidates. Demonstrate this known breakage with a new test in t7405-submodule-merge covering the case. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jm/maint-apply-detects-corrupt-patch-header'Junio C Hamano2011-10-192-0/+46
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jm/maint-apply-detects-corrupt-patch-header: fix "git apply --index ..." not to deref NULL
| * | | | | fix "git apply --index ..." not to deref NULLJim Meyering2011-10-122-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed this when "git am CORRUPTED" unexpectedly failed with an odd diagnostic, and even removed one of the files it was supposed to have patched. Reproduce with any valid old/new patch from which you have removed the "+++ b/FILE" line. You'll see a diagnostic like this fatal: unable to write file '(null)' mode 100644: Bad address and you'll find that FILE has been removed. The above is on glibc-based systems. On other systems, rather than getting "null", you may provoke a segfault as git tries to dereference the NULL file name. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jk/config-test-cleanup'Junio C Hamano2011-10-191-12/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/config-test-cleanup: t1300: attempting to remove a non-existent .git/config is not an error