summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2010-04-19patch-id: Add support for mbox formatPaolo Bonzini
I have an alias that takes two arguments and compares their patch IDs. I would like to use to make sure I've tested exactly what I submit (patch by patch), like git patch-cmp origin/master.. file-being-sent However, I cannot do that because git patch-id is fooled by the "-- " trailer that git format-patch puts, or likely by the MIME boundary. This patch adds hunk parsing logic to git patch-id in order to detect an out of place "-" line and split the patch when it comes. In addition, commit ids in the "From " lines are considered and printed in the output. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-19Merge branch 'jg/auto-initialize-notes-with-percent-n-in-format'Junio C Hamano
* jg/auto-initialize-notes-with-percent-n-in-format: t3301: add tests to use --format="%N" pretty: Initialize notes if %N is used
2010-04-18t3301: add tests to use --format="%N"Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17Merge branch 'maint'Junio C Hamano
* maint: t1010-mktree: Adjust expected result to code and documentation combined diff: correctly handle truncated file Document new "already-merged" rule for branch -d
2010-04-17t6006: do not write to /tmpMatthew Ogilvie
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17t1010-mktree: Adjust expected result to code and documentationMichael J Gruber
The last two tests here were always supposed to fail in the sense that, according to code and documentation, mktree should read non-recursive ls-tree output, but not recursive one, and therefore explicitely refuses to deal with slashes. Adjust the test (must_fail) so that it succeeds when mktree dies on slashes. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17combined diff: correctly handle truncated fileThomas Rast
Consider an evil merge of two commits A and B, both of which have a file 'foo', but the merge result does not have that file. The combined-diff code learned in 4462731 (combine-diff: do not punt on removed or added files., 2006-02-06) to concisely show only the removal, since that is the evil part and the previous contents are presumably uninteresting. However, to diagnose an empty merge result, it overloaded the variable that holds the file's length. This means that the check also triggers for truncated files. Consequently, such files were not shown in the diff at all despite the merge being clearly evil. Fix this by adding a new variable that distinguishes whether the file was deleted (which is the case 4462731 handled) or truncated. In the truncated case, we show the full combined diff again, which is rather spammy but at least does not hide the evilness. Reported-by: David Martínez Martí <desarrollo@gestiweb.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11t3507: Make test executableStephen Boyd
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10Merge branch 'jl/maint-submodule-gitfile-awareness'Junio C Hamano
* jl/maint-submodule-gitfile-awareness: Teach diff --submodule and status to handle .git files in submodules
2010-04-10Teach diff --submodule and status to handle .git files in submodulesJens Lehmann
The simple test for an existing .git directory gives an incorrect result if .git is a file that records "gitdir: overthere". So for submodules that use a .git file, "git status" and the diff family - when the "--submodule" option is given - did assume the submodule was not populated at all when a .git file was used, thus generating wrong output or no output at all. This is fixed by using read_gitfile_gently() to get the correct location of the .git directory. While at it, is_submodule_modified() was cleaned up to use the "dir" member of "struct child_process" instead of setting the GIT_WORK_TREE and GIT_DIR environment variables. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10Merge branch 'ef/maint-empty-commit-log' into maintJunio C Hamano
* ef/maint-empty-commit-log: rev-list: fix --pretty=oneline with empty message
2010-04-10Merge branch 'jc/conflict-marker-size' into maintJunio C Hamano
* jc/conflict-marker-size: diff --check: honor conflict-marker-size attribute
2010-04-07Merge branch 'mg/notes-reflog'Junio C Hamano
* mg/notes-reflog: refs.c: Write reflogs for notes just like for branch heads t3301-notes: Test the creation of reflog entries
2010-04-06Merge branch 'sb/fmt-merge-msg'Junio C Hamano
* sb/fmt-merge-msg: fmt-merge-msg: hide summary option fmt-merge-msg: remove custom string_list implementation string-list: add unsorted_string_list_lookup() fmt-merge-msg: use pretty.c routines t6200: test fmt-merge-msg more t6200: modernize with test_tick fmt-merge-msg: be quiet if nothing to merge
2010-04-06Merge branch 'jc/conflict-marker-size'Junio C Hamano
* jc/conflict-marker-size: diff --check: honor conflict-marker-size attribute
2010-04-06Merge branch 'ef/maint-empty-commit-log'Junio C Hamano
* ef/maint-empty-commit-log: rev-list: fix --pretty=oneline with empty message
2010-04-03Merge branch 'mb/rebase-i-no-ff'Junio C Hamano
* mb/rebase-i-no-ff: Teach rebase the --no-ff option. Conflicts: git-rebase--interactive.sh t/t3404-rebase-interactive.sh
2010-04-03Merge branch 'jn/merge-diff3-label'Junio C Hamano
* jn/merge-diff3-label: merge-recursive: add a label for ancestor cherry-pick, revert: add a label for ancestor revert: clarify label on conflict hunks compat: add mempcpy() checkout -m --conflict=diff3: add a label for ancestor merge_trees(): add ancestor label parameter for diff3-style output merge_file(): add comment explaining behavior wrt conflict style checkout --conflict=diff3: add a label for ancestor ll_merge(): add ancestor label parameter for diff3-style output merge-file --diff3: add a label for ancestor xdl_merge(): move file1 and file2 labels to xmparam structure xdl_merge(): add optional ancestor label to diff3-style output tests: document cherry-pick behavior in face of conflicts tests: document format of conflicts from checkout -m Conflicts: builtin/revert.c
2010-04-03Merge branch 'bc/t5505-fix'Junio C Hamano
* bc/t5505-fix: t/t5505-remote.sh: escape * to prevent interpretation by shell as glob t5505: add missing && t5505: remove unnecessary subshell invocations
2010-04-03Merge branch 'bc/acl-test'Junio C Hamano
* bc/acl-test: t/t1304: make a second colon optional in the mask ACL check t/t1304: set the ACL effective rights mask t/t1304: use 'test -r' to test readability rather than looking at mode bits t/t1304: set the Default ACL base entries t/t1304: avoid -d option to setfacl
2010-04-03Merge branch 'do/rebase-i-arbitrary'Junio C Hamano
* do/rebase-i-arbitrary: rebase--interactive: don't require what's rebased to be a branch Conflicts: t/t3404-rebase-interactive.sh
2010-03-31Merge branch 'jc/maint-refs-dangling' into maintJunio C Hamano
* jc/maint-refs-dangling: refs: ref entry with NULL sha1 is can be a dangling symref
2010-03-30Merge branch 'maint'Junio C Hamano
* maint: format-patch: Squelch 'fatal: Not a range." error
2010-03-30format-patch: Squelch 'fatal: Not a range." errorKevin Ballard
Don't output an error on `git format-patch --ignore-if-in-upstream HEAD`. This matches the behavior of `git format-patch HEAD`. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30refs.c: Write reflogs for notes just like for branch headsMichael J Gruber
The notes code intends to write reflog entries, but currently they are not written because log_ref_write() checks for the refname path explicitly. Add refs/notes to the list of allowed paths so that notes references are treated just like branch heads, i.e. according to core.logAllRefUpdates and core.bare. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30t3301-notes: Test the creation of reflog entriesMichael J Gruber
Test whether the notes code writes reflog entries. It intends to (setting up the reflog messages) but currently does not. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-29Merge branch 'cc/cherry-pick-ff'Junio C Hamano
* cc/cherry-pick-ff: revert: fix tiny memory leak in cherry-pick --ff rebase -i: use new --ff cherry-pick option Documentation: describe new cherry-pick --ff option cherry-pick: add tests for new --ff option revert: add --ff option to allow fast forward when cherry-picking builtin/merge: make checkout_fast_forward() non static parse-options: add parse_options_concat() to concat options
2010-03-29Merge branch 'sb/notes-parse-opt'Junio C Hamano
* sb/notes-parse-opt: notes: rework subcommands and parse options Conflicts: builtin/notes.c
2010-03-29rebase -i: make post-rewrite work for 'edit'Thomas Rast
The post-rewrite support, in the form of the call to 'record_in_rewritten', was hidden in the arm where we have to record a new commit for the user. This meant that it was never invoked in the case where the user has already amended the commit by herself. [The test is designed to exercise both arms of the 'if' in question.] Furthermore, recording the stopped-sha (the SHA1 of the commit before the editing) suffered from a cut&paste error from die_with_patch and used the wrong variable, hence it never recorded anything. Noticed by Junio. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-29Merge branch 'cp/add-u-pathspec' into maintJunio C Hamano
* cp/add-u-pathspec: test for add with non-existent pathspec git add -u: die on unmatched pathspec
2010-03-29Merge branch 'maint'Junio C Hamano
* maint: t9350: fix careless use of "cd" difftool: Fix '--gui' when diff.guitool is unconfigured fast-export: don't segfault when marks file cannot be opened
2010-03-29t9350: fix careless use of "cd"Junio C Hamano
Upon failure of any of these tests (or when a test that is marked as expecting a failure is fixed), we will end up running later tests in random places. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28difftool: Fix '--gui' when diff.guitool is unconfiguredDavid Aguilar
When diff.guitool is unconfigured and "--gui" is specified git-difftool dies with the following error message: config diff.guitool: command returned error: 1 Catch the error so that the "--gui" flag is a no-op when diff.guitool is unconfigured. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-25t6200: test fmt-merge-msg moreStephen Boyd
Add some more tests so we don't break behavior upon modernizing fmt-merge-msg. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-25t6200: modernize with test_tickStephen Boyd
This test defines its own version of test_tick. Get rid of it. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-25fmt-merge-msg: be quiet if nothing to mergeStephen Boyd
When FETCH_HEAD contains only 'not-for-merge' entries fmt-merge-msg still outputs "Merge" (and if the branch isn't master " into <branch>"). In this case fmt-merge-msg is outputting junk and should really just be quiet. Fix it. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-25diff --check: honor conflict-marker-size attributeJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24Merge branch 'tr/notes-display'Junio C Hamano
* tr/notes-display: git-notes(1): add a section about the meaning of history notes: track whether notes_trees were changed at all notes: add shorthand --ref to override GIT_NOTES_REF commit --amend: copy notes to the new commit rebase: support automatic notes copying notes: implement helpers needed for note copying during rewrite notes: implement 'git notes copy --stdin' rebase -i: invoke post-rewrite hook rebase: invoke post-rewrite hook commit --amend: invoke post-rewrite hook Documentation: document post-rewrite hook Support showing notes from more than one notes tree test-lib: unset GIT_NOTES_REF to stop it from influencing tests Conflicts: git-am.sh refs.c
2010-03-24Merge branch 'jl/submodule-diff-dirtiness'Junio C Hamano
* jl/submodule-diff-dirtiness: git status: ignoring untracked files must apply to submodules too git status: Fix false positive "new commits" output for dirty submodules Refactor dirty submodule detection in diff-lib.c git status: Show detailed dirty status of submodules in long format git diff --submodule: Show detailed dirty status of submodules
2010-03-24Merge branch 'pb/log-first-parent-p-m'Junio C Hamano
* pb/log-first-parent-p-m: show --first-parent/-m: do not default to --cc show -c: show patch text revision: introduce setup_revision_opt t4013: add tests for log -p -m --first-parent git log -p -m: document -m and honor --first-parent
2010-03-24Merge branch 'jc/maint-refs-dangling'Junio C Hamano
* jc/maint-refs-dangling: refs: ref entry with NULL sha1 is can be a dangling symref
2010-03-24Merge branch 'jc/color-attrs' into maintJunio C Hamano
* jc/color-attrs: color: allow multiple attributes
2010-03-24Merge branch 'jk/maint-add-ignored-dir' into maintJunio C Hamano
* jk/maint-add-ignored-dir: tests for "git add ignored-dir/file" without -f dir: fix COLLECT_IGNORED on excluded prefixes t0050: mark non-working test as such
2010-03-24Merge branch 'bg/apply-fix-blank-at-eof' into maintJunio C Hamano
* bg/apply-fix-blank-at-eof: t3417: Add test cases for "rebase --whitespace=fix" t4124: Add additional tests of --whitespace=fix apply: Allow blank context lines to match beyond EOF apply: Remove the quick rejection test apply: Don't unnecessarily update line lengths in the preimage
2010-03-24Teach rebase the --no-ff option.Marc Branchaud
For git-rebase.sh, --no-ff is a synonym for --force-rebase. For git-rebase--interactive.sh, --no-ff cherry-picks all the commits in the rebased branch, instead of fast-forwarding over any unchanged commits. --no-ff offers an alternative way to deal with reverted merges. Instead of "reverting the revert" you can use "rebase --no-ff" to recreate the branch with entirely new commits (they're new because at the very least the committer time is different). This obviates the need to revert the reversion, as you can re-merge the new topic branch directly. Added an addendum to revert-a-faulty-merge.txt describing the situation and how to use --no-ff to handle it. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21rev-list: fix --pretty=oneline with empty messageErik Faye-Lund
55246aa (Dont use "<unknown>" for placeholders and suppress printing of empty user formats) introduced a check to prevent empty user-formats from being printed. This test didn't take empty commit messages into account, and prevented the line-termination from being output. This lead to multiple commits on a single line. Correct it by guarding the check with a check for user-format. A similar correction for the --graph code-path has been included. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21cherry-pick, revert: add a label for ancestorJonathan Nieder
When writing conflict hunks in ‘diff3 -m’ format, also add a label to the common ancestor. Especially in a cherry-pick, it is not immediately obvious without such a label what the common ancestor represents. git rerere does not have trouble parsing the new output and its preimage ids are unchanged since it includes its own code for recreating conflict hunks. No other code in git parses conflict hunks. Requested-by: Stefan Monnier <monnier@iro.umontreal.ca> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21revert: clarify label on conflict hunksJonathan Nieder
When reverting a commit, the commit being merged is not the commit to revert itself but its parent. Add “parent of” to the conflict hunk label to make this more clear. The conflict hunk labels are all pieces of a single string written in the new get_message() function. Avoid some complication by using mempcpy to advance a pointer as the result is written. Also free the corresponding temporary buffer (it was leaked before). This is not important because it is a small one-time allocation. It would become a memory leak if unnoticed when libifying revert. This patch uses calls to strlen() instead of integer constants in some places. GCC will compute the length at compile time; I am not sure about other compilers, but this is not performance-critical anyway. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21checkout -m --conflict=diff3: add a label for ancestorJonathan Nieder
git checkout --merge --conflict=diff3 can be used to present conflict hunks including text from the common ancestor. The added information is helpful for resolving a merge by hand, and merge tools tend to understand it because it is very similar to what ‘diff3 -m’ produces. Unlike current git, diff3 -m includes a label for the merge base on the ||||||| line, and unfortunately, some tools cannot parse the conflict hunks without it. Humans can benefit from a cue when learning to interpreting the format, too. Mark the start of the text from the old branch with a label based on the branch’s name. git rerere does not have trouble parsing this output and its preimage ids are unchanged since it includes its own code for recreating conflict hunks. No other code in git tries to parse conflict hunks. Requested-by: Stefan Monnier <monnier@iro.umontreal.ca> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21checkout --conflict=diff3: add a label for ancestorJonathan Nieder
git checkout --conflict=diff3 can be used to present conflicts hunks including text from the common ancestor: <<<<<<< ours ourside ||||||| original ======= theirside >>>>>>> theirs The added information is helpful for resolving a merge by hand, and merge tools can usually understand it without trouble because it looks like output from ‘diff3 -m’. diff3 includes a label for the merge base on the ||||||| line, and it seems some tools (for example, Emacs 22’s smerge-mode) cannot parse conflict hunks without such a label. Humans could use help in interpreting the output, too. So change the marker for the start of the text from the common ancestor to include the label “base”. git rerere’s conflict identifiers are not affected: to parse conflict hunks, rerere looks for whitespace after the ||||||| marker rather than a newline, and to compute preimage ids, rerere has its own code for creating conflict hunks. No other code in git tries to parse conflict hunks. Requested-by: Stefan Monnier <monnier@iro.umontreal.ca> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>