summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2009-01-17checkout: implement "-" abbreviation, add docs and testsLibravatar Thomas Rast1-0/+50
Have '-' mean the same as '@{-1}', i.e., the last branch we were on. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17sha1_name: support @{-N} syntax in get_sha1()Libravatar Thomas Rast1-0/+71
Let get_sha1() parse the @{-N} syntax, with docs and tests. Note that while @{-1}^2, @{-2}~5 and such are supported, @{-1}@{1} is currently not allowed. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15Merge branch 'maint'Libravatar Junio C Hamano2-0/+34
* maint: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano2-0/+34
* maint-1.6.0: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15t3404: Add test case for auto-amending only edited commits after "edit"Libravatar Stephan Beyer1-0/+17
Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15t3404: Add test case for aborted --continue after "edit"Libravatar Stephan Beyer1-0/+15
Add a test case for the bugfix introduced by commit 8beb1f33d "git-rebase-interactive: do not squash commits on abort". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15t3501: check that commits are actually doneLibravatar Stephan Beyer1-0/+2
The basic idea of t3501 is to check whether revert and cherry-pick works on renamed files. But as there is no pure cherry-pick/revert test, it is good to also check if commits are actually done in that scenario. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14Merge branch 'maint'Libravatar Junio C Hamano2-0/+25
* maint: Update draft release notes to 1.6.1.1 Make t3411 executable fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-14Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano1-0/+25
* maint-1.6.0: fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-14Make t3411 executableLibravatar Miklos Vajna1-0/+0
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14fix handling of multiple untracked files for git mv -kLibravatar Michael J Gruber1-1/+1
The "-k" option to "git mv" should allow specifying multiple untracked files. Currently, multiple untracked files raise an assertion if they appear consecutively as arguments. Fix this by decrementing the loop index after removing one entry from the array of arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14add test cases for "git mv -k"Libravatar Michael J Gruber1-0/+25
Add test cases for ignoring nonexisting and untracked files using the -k option to "git mv". There is one known breakage related to multiple untracked files specfied as consecutive arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Merge branch 'nd/grep-assume-unchanged'Libravatar Junio C Hamano1-0/+7
* nd/grep-assume-unchanged: grep: grep cache entries if they are "assume unchanged" grep: support --no-ext-grep to test builtin grep
2009-01-13Merge branch 'js/bundle-tags'Libravatar Junio C Hamano1-0/+33
* js/bundle-tags: bundle: allow rev-list options to exclude annotated tags
2009-01-13Merge branch 'js/add-not-submodule'Libravatar Junio C Hamano1-0/+25
* js/add-not-submodule: git add: do not add files from a submodule
2009-01-13Merge branch 'cb/maint-unpack-trees-absense'Libravatar Junio C Hamano1-0/+51
* cb/maint-unpack-trees-absense: unpack-trees: remove redundant path search in verify_absent unpack-trees: fix path search bug in verify_absent unpack-trees: handle failure in verify_absent
2009-01-13Merge branch 'mc/cd-p-pwd'Libravatar Junio C Hamano1-2/+2
* mc/cd-p-pwd: git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
2009-01-13Merge branch 'js/maint-merge-recursive-r-d-conflict' into maintLibravatar Junio C Hamano1-0/+23
* js/maint-merge-recursive-r-d-conflict: merge-recursive: mark rename/delete conflict as unmerged
2009-01-13Merge branch 'cb/maint-merge-recursive-fix' into maintLibravatar Junio C Hamano1-0/+87
* cb/maint-merge-recursive-fix: merge-recursive: do not clobber untracked working tree garbage modify/delete conflict resolution overwrites untracked file Conflicts: builtin-merge-recursive.c
2009-01-13Merge branch 'ap/maint-apply-modefix' into maintLibravatar Junio C Hamano1-0/+62
* ap/maint-apply-modefix: builtin-apply: prevent non-explicit permission changes
2009-01-11Merge branch 'jc/maint-do-not-switch-to-non-commit' into maintLibravatar Junio C Hamano1-0/+4
* jc/maint-do-not-switch-to-non-commit: git checkout: do not allow switching to a tree-ish that is not a commit
2009-01-11git-svn: add --authors-file testLibravatar Eric Wong1-0/+94
I'm not sure how often this functionality is used, but in case it's not, having an extra test here will help catch breakage sooner. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-10t7501-commit.sh: explicitly check that -F prevents invoking the editorLibravatar Adeodato Simó2-4/+21
The "--signoff" test case in t7500-commit.sh was setting VISUAL while using -F -, which indeed tested that the editor is not spawned with -F. However, having it there was confusing, since there was no obvious reason to the casual reader for it to be there. This commits removes the setting of VISUAL from the --signoff test, and adds in t7501-commit.sh a dedicated test case, where the rest of tests for -F are. Signed-off-by: Adeodato Simó <dato@net.com.org.es> Okay-then-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-10filter-branch: add git_commit_non_empty_tree and --prune-empty.Libravatar Pierre Habouzit1-0/+8
git_commit_non_empty_tree is added to the functions that can be run from commit filters. Its effect is to commit only commits actually touching the tree and that are not merge points either. The option --prune-empty is added. It defaults the commit-filter to 'git_commit_non_empty_tree "$@"', and can be used with any other combination of filters, except --commit-hook that must used 'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"' usually to achieve the same result. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-07Merge branch 'rs/diff-ihc'Libravatar Junio C Hamano1-0/+92
* rs/diff-ihc: diff: add option to show context between close hunks Conflicts: Documentation/diff-options.txt
2009-01-07Merge branch 'js/maint-merge-recursive-r-d-conflict'Libravatar Junio C Hamano1-0/+23
* js/maint-merge-recursive-r-d-conflict: merge-recursive: mark rename/delete conflict as unmerged
2009-01-07Merge branch 'cb/merge-recursive-fix'Libravatar Junio C Hamano1-0/+87
* cb/merge-recursive-fix: merge-recursive: do not clobber untracked working tree garbage modify/delete conflict resolution overwrites untracked file
2009-01-05unpack-trees: fix path search bug in verify_absentLibravatar Clemens Buchacher1-0/+27
Commit 0cf73755 (unpack-trees.c: assume submodules are clean during check-out) changed an argument to verify_absent from 'path' to 'ce', which is however shadowed by a local variable of the same name. The bug triggers if verify_absent is used on a tree entry, for which the index contains one or more subsequent directories of the same length. The affected subdirectories are removed from the index. The testcase included in this commit bisects to 55218834 (checkout: do not lose staged removal), which reveals the bug in this case, but is otherwise unrelated. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05unpack-trees: handle failure in verify_absentLibravatar Clemens Buchacher1-0/+24
Commit 203a2fe1 (Allow callers of unpack_trees() to handle failure) changed the "die on error" behavior to "return failure code". verify_absent did not handle errors returned by verify_clean_subdirectory, however. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS XLibravatar Marcel M. Cary1-2/+2
On Mac OS X and possibly BSDs, /bin/pwd reads PWD from the environment if available and shows the logical path by default rather than the physical one. Unset PWD before running /bin/pwd in both cd_to_toplevel and its test. Still use the external /bin/pwd because in my Bash on Linux, the builtin pwd prints the same result whether or not PWD is set. Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org> Tested-by: Wincent Colaiuta <win@wincent.com> (on Mac OS X 10.5.5) Tested-by: Marcel Koeppen <git-dev@marzelpan.de> (on Mac OS X 10.5.6) Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05git add: do not add files from a submoduleLibravatar Johannes Schindelin1-0/+25
It comes quite as a surprise to an unsuspecting Git user that calling "git add submodule/file" (which is a mistake, alright) _removes_ the submodule in the index, and adds the file. Instead, complain loudly. While at it, be nice when the user said "git add submodule/" which is most likely the consequence of tab-completion, and stage the submodule, instead of trying to add the contents of that directory. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05bundle: allow rev-list options to exclude annotated tagsLibravatar Johannes Schindelin1-0/+33
With options such as "--all --since=2.weeks.ago", annotated tags used to be included, when they should have been excluded. The reason is that we heavily abuse the revision walker to determine what needs to be included or excluded. And the revision walker does not show tags at all (and therefore never marks tags as uninteresting). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-03Merge branch 'jc/maint-do-not-switch-to-non-commit'Libravatar Junio C Hamano1-0/+4
* jc/maint-do-not-switch-to-non-commit: git checkout: do not allow switching to a tree-ish that is not a commit
2009-01-03Merge branch 'ap/maint-apply-modefix'Libravatar Junio C Hamano1-0/+62
* ap/maint-apply-modefix: builtin-apply: prevent non-explicit permission changes
2009-01-03git checkout: do not allow switching to a tree-ish that is not a commitLibravatar Junio C Hamano1-0/+4
"git checkout -b newbranch $commit^{tree}" mistakenly created a new branch rooted at the current HEAD, because in that case, the two structure fields used to see if the command was invoked without any argument (hence it needs to default to checking out the HEAD) were populated incorrectly. Upon seeing a command line argument that we took as a rev, we should store that string in new.name, even if that does not name a commit. This will correctly trigger the existing safety logic. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Daniel Barkalow <barkalow@iabervon.org>
2009-01-02builtin-apply: prevent non-explicit permission changesLibravatar Junio C Hamano1-0/+62
A git patch that does not change the executable bit records the mode bits on its "index" line. "git apply" used to interpret this mode exactly the same way as it interprets the mode recorded on "new mode" line, as the wish by the patch submitter to set the mode to the one recorded on the line. The reason the mode does not agree between the submitter and the receiver in the first place is because there is _another_ commit that only appears on one side but not the other since their histories diverged, and that commit changes the mode. The patch has "index" line but not "new mode" line because its change is about updating the contents without affecting the mode. The application of such a patch is an explicit wish by the submitter to only cherry-pick the commit that updates the contents without cherry-picking the commit that modifies the mode. Viewed this way, the current behaviour is problematic, even though the command does warn when the mode of the path being patched does not match this mode, and a careful user could detect this inconsistencies between the patch submitter and the patch receiver. This changes the semantics of the mode recorded on the "index" line; instead of interpreting it as the submitter's wish to set the mode to the recorded value, it merely informs what the mode submitter happened to have, and the presense of the "index" line is taken as submitter's wish to keep whatever the mode is on the receiving end. This is based on the patch originally done by Alexander Potashev with a minor fix; the tests are mine. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-29Merge branch 'np/auto-thread'Libravatar Junio C Hamano1-0/+1
* np/auto-thread: Force t5302 to use a single thread pack-objects: don't use too many threads with few objects autodetect number of CPUs by default when using threads
2008-12-29diff: add option to show context between close hunksLibravatar René Scharfe1-0/+92
Merge two hunks if there is only the specified number of otherwise unshown context between them. For --inter-hunk-context=1, the resulting patch has the same number of lines but shows uninterrupted context instead of a context header line in between. Patches generated with this option are easier to read but are also more likely to conflict if the file to be patched contains other changes. This patch keeps the default for this option at 0. It is intended to just make the feature available in order to see its advantages and downsides. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27grep: grep cache entries if they are "assume unchanged"Libravatar Nguyễn Thái Ngọc Duy1-0/+7
"Assume unchanged" bit means "please pretend that I have never touched this file", so if user removes the file, we should not care. This patch teaches "git grep" to use cache version in such situations. External grep case has not been fixed yet. But given that on the platform that CE_VALID bit may be used like Windows, external grep is not available anyway, I would wait for people to raise their hands before touching it. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27Merge branch 'sp/maint-describe-all-tag-warning' into maintLibravatar Junio C Hamano1-0/+6
* sp/maint-describe-all-tag-warning: describe: Avoid unnecessary warning when using --all
2008-12-26describe: Avoid unnecessary warning when using --allLibravatar Shawn O. Pearce1-0/+6
In 212945d4 ("Teach git-describe to verify annotated tag names before output") git-describe learned how to output a warning if an annotated tag object was matched but its internal name doesn't match the local ref name. However, "git describe --all" causes the local ref name to be prefixed with "tags/", so we need to skip over this prefix before comparing the local ref name with the name recorded inside of the tag object. Patch-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-24merge-recursive: mark rename/delete conflict as unmergedLibravatar Johannes Schindelin1-0/+23
When a file was renamed in one branch, but deleted in the other, one should expect the index to contain an unmerged entry, namely the target of the rename. Make it so. Noticed by Constantine Plotnikov. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-24Merge branch 'js/rebase-i-p'Libravatar Junio C Hamano1-11/+45
* js/rebase-i-p: rebase -i -p: leave a --cc patch when a merge could not be redone rebase -i -p: Fix --continue after a merge could not be redone Show a failure of rebase -p if the merge had a conflict
2008-12-24rebase -i -p: leave a --cc patch when a merge could not be redoneLibravatar Johannes Schindelin1-0/+1
The result is easier to review this way, and the merge resolution has to be done inside the work tree, not by adjusting "the patch" anyway.
2008-12-22t9129: skip the last three tests if UTF-8 locale is not availableLibravatar Miklos Vajna1-13/+17
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-21Make sure lockfiles are unlocked when dying on SIGPIPELibravatar Junio C Hamano1-0/+17
We cleaned up lockfiles upon receiving the usual suspects HUP, TERM, QUIT but a wicked user could kill us of asphyxiation by piping our output to a pipe that does not read. Protect ourselves by catching SIGPIPE and clean up the lockfiles as well in such a case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-21git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dirLibravatar Marcel M. Cary2-0/+115
I want directories of my working tree to be linked to from various paths on my filesystem where third-party components expect them, both in development and production environments. A build system's install step could solve this, but I develop scripts and web pages that don't need to be built. Git's submodule system could solve this, but we tend to develop, branch, and test those directories all in unison, so one big repository feels more natural. We prefer to edit and commit on the symlinked paths, not the canonical ones, and in that setting, "git pull" fails to find the top-level directory of the repository while other commands work fine. "git pull" fails because POSIX shells have a notion of current working directory that is different from getcwd(). The shell stores this path in PWD. As a result, "cd ../" can be interpreted differently in a shell script than chdir("../") in a C program. The shell interprets "../" by essentially stripping the last textual path component from PWD, whereas C chdir() follows the ".." link in the current directory on the filesystem. When PWD is a symlink, these are different destinations. As a result, Git's C commands find the correct top-level working tree, and shell scripts do not. Changes: * When interpreting a relative upward (../) path in cd_to_toplevel, prepend the cwd without symlinks, given by /bin/pwd * Add tests for cd_to_toplevel and "git pull" in a symlinked directory that failed before this fix, plus contrasting scenarios that already worked Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-21rebase -i -p: Fix --continue after a merge could not be redoneLibravatar Johannes Sixt1-1/+1
When a merge that has a conflict was rebased, then rebase stopped to let the user resolve the conflicts. However, thereafter --continue failed because the author-script was not saved. (This is rebase -i's way to preserve a commit's authorship.) This fixes it by doing taking the same failure route after a merge that is also taken after a normal cherry-pick. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-21Show a failure of rebase -p if the merge had a conflictLibravatar Johannes Sixt1-11/+44
This extends t3409-rebase-preserve-merges by a case where the merge that is rebased has a conflict. Therefore, the rebase stops and expects that the user resolves the conflict. However, currently rebase --continue fails because .git/rebase-merge/author-script is missing. The test script had allocated two identical clones, but only one of them (clone2) was used. Now we use both as indicated in the comment. Also, two instances of && was missing in the setup part. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-19Merge branch 'maint' to sync with GIT 1.6.0.6Libravatar Junio C Hamano2-0/+38
Signed-off-by: Junio C Hamano <gitster@pobox.com>