summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2015-02-17commit: avoid race when creating orphan commitsLibravatar Michael Haggerty1-1/+1
If HEAD doesn't point at anything during the initial check, then we should make sure that it *still* doesn't point at anything when we are ready to update the reference. Otherwise, another process might commit while we are working (e.g., while we are waiting for the user to edit the commit message) and we will silently overwrite it. This fixes a failing test in t7516. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17commit: add tests of commit racesLibravatar Michael Haggerty1-0/+30
Committing involves the following steps: 1. Determine the current value of HEAD (if any). 2. Create the new commit object. 3. Update HEAD. Please note that step 2 can take arbitrarily long, because it might involve the user editing a commit message. If a second process sneaks in a commit during step 2, then the first commit process should fail. This is usually done correctly, because step 3 verifies that HEAD still points at the same commit that it pointed to during step 1. However, if there is a race when creating an *orphan* commit, then the test in step 3 is skipped. Add tests for proper handling of such races. One of the new tests fails. It will be fixed in a moment. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11Merge branch 'jc/push-to-checkout'Libravatar Junio C Hamano1-0/+63
Extending the js/push-to-deploy topic, the behaviour of "git push" when updating the working tree and the index with an update to the branch that is checked out can be tweaked by push-to-checkout hook. * jc/push-to-checkout: receive-pack: support push-to-checkout hook receive-pack: refactor updateInstead codepath
2015-02-11Merge branch 'sb/atomic-push'Libravatar Junio C Hamano1-0/+194
"git push" has been taught a "--atomic" option that makes push to update more than one ref an "all-or-none" affair. * sb/atomic-push: Document receive.advertiseatomic t5543-atomic-push.sh: add basic tests for atomic pushes push.c: add an --atomic argument send-pack.c: add --atomic command line argument send-pack: rename ref_update_to_be_sent to check_to_send_update receive-pack.c: negotiate atomic push support receive-pack.c: add execute_commands_atomic function receive-pack.c: move transaction handling in a central place receive-pack.c: move iterating over all commands outside execute_commands receive-pack.c: die instead of error in case of possible future bug receive-pack.c: shorten the execute_commands loop over all commands
2015-02-11Merge branch 'cj/log-invert-grep'Libravatar Junio C Hamano1-0/+15
"git log --invert-grep --grep=WIP" will show only commits that do not have the string "WIP" in their messages. * cj/log-invert-grep: log: teach --invert-grep option
2015-02-11Merge branch 'dk/format-patch-ignore-diff-submodule'Libravatar Junio C Hamano1-0/+72
Setting diff.submodule to 'log' made "git format-patch" produce broken patches. * dk/format-patch-ignore-diff-submodule: format-patch: ignore diff.submodule setting t4255: test am submodule with diff.submodule
2015-02-11Merge branch 'ld/p4-exclude-in-sync'Libravatar Junio C Hamano1-0/+71
Like the "clone" subcommand, allow excluding subdirectories in the "sync" subcommand. * ld/p4-exclude-in-sync: git-p4: support excluding paths on sync
2015-02-11git-p4: support excluding paths on syncLibravatar Luke Diamand1-0/+71
The clone subcommand has long had support for excluding subdirectories, but sync has not. This is a nuisance, since as soon as you do a sync, any changed files that were initially excluded start showing up. Move the "exclude" command-line option into the parent class; the actual behavior was already present there so it simply had to be exposed. Signed-off-by: Luke Diamand <luke@diamand.org> Reviewed-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11Merge branch 'ak/typofixes'Libravatar Junio C Hamano1-1/+1
* ak/typofixes: t/lib-terminal.sh: fix typo pack-bitmap: fix typo
2015-01-22Merge branch 'js/t1050'Libravatar Junio C Hamano1-6/+6
* js/t1050: t1050-large: generate large files without dd
2015-01-22Merge branch 'jh/empty-notes'Libravatar Junio C Hamano1-1/+1
* jh/empty-notes: Fix unclosed here document in t3301.sh
2015-01-22Fix unclosed here document in t3301.shLibravatar Kacper Kornet1-1/+1
Commit 908a3203632a02568df230c0fccf9a2cd8da24e6 introduced indentation to here documents in t3301.sh. However in one place <<-EOF was missing -, which broke this test when run with mksh-50d. This commit fixes it. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-21t/lib-terminal.sh: fix typoLibravatar Alexander Kuleshov1-1/+1
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-20Merge branch 'jk/colors'Libravatar Junio C Hamano1-0/+4
* jk/colors: parse_color: fix return value for numeric color values 0-8
2015-01-20parse_color: fix return value for numeric color values 0-8Libravatar Jeff King1-0/+4
When commit 695d95d refactored the color parsing, it missed a "return 0" when parsing literal numbers 0-8 (which represent basic ANSI colors), leading us to report these colors as an error. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-14t1050-large: generate large files without ddLibravatar Johannes Sixt1-6/+6
For some unknown reason, the dd on my Windows box segfaults randomly, but since recently, it does so much more often than it used to, which makes running the test suite burdensome. Use printf to write large files instead of dd. To emphasize that three of the large blobs are exact copies, use cp to allocate them. The new code makes the files a bit smaller, and they are not sparse anymore, but the tests do not depend on these properties. We do not want to use test-genrandom here (which is used to generate large files elsewhere in t1050), so that the files can be compressed well (which keeps the run-time short). The files are now large text files, not binary files. But since they are larger than core.bigfilethreshold they are diagnosed as binary by Git. For this reason, the 'git diff' tests that check the output for "Binary files differ" still pass. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-14Merge branch 'rc/for-each-ref-tracking'Libravatar Junio C Hamano1-0/+13
* rc/for-each-ref-tracking: for-each-ref: always check stat_tracking_info()'s return value
2015-01-14Merge branch 'rh/test-color-avoid-terminfo-in-original-home'Libravatar Junio C Hamano1-44/+48
We try to see if "tput" gives a useful result before switching TERM to dumb and moving HOME to point to our fake location for stability of the tests, and then use the command when coloring the output from the tests, but there is no guarantee "tput" works after switching HOME. * rh/test-color-avoid-terminfo-in-original-home: test-lib.sh: do tests for color support after changing HOME test-lib: use 'test ...' instead of '[ ... ]'
2015-01-14Merge branch 'rh/hide-prompt-in-ignored-directory'Libravatar Junio C Hamano1-0/+106
* rh/hide-prompt-in-ignored-directory: git-prompt.sh: allow to hide prompt for ignored pwd git-prompt.sh: if pc mode, immediately set PS1 to a plain prompt
2015-01-14Merge branch 'jk/prune-packed-server-info'Libravatar Junio C Hamano1-0/+11
Fix recent breakage in Git 2.2 that started creating info/refs and objects/info/packs files with permission bits tighter than user's umask. * jk/prune-packed-server-info: update-server-info: create info/* with mode 0666 t1301: set umask in reflog sharedrepository=group test
2015-01-14Merge branch 'js/remote-add-with-insteadof'Libravatar Junio C Hamano1-0/+5
"git remote add $name $URL" is now allowed when "url.$URL.insteadOf" is already defined. * js/remote-add-with-insteadof: Add a regression test for 'git remote add <existing> <same-url>' git remote: allow adding remotes agreeing with url.<...>.insteadOf
2015-01-13log: teach --invert-grep optionLibravatar Christoph Junghans1-0/+15
"git log --grep=<string>" shows only commits with messages that match the given string, but sometimes it is useful to be able to show only commits that do *not* have certain messages (e.g. "show me ones that are not FIXUP commits"). Originally, we had the invert-grep flag in grep_opt, but because "git grep --invert-grep" does not make sense except in conjunction with "--files-with-matches", which is already covered by "--files-without-matches", it was moved it to revisions structure. To have the flag there expresses the function to the feature better. When the newly inserted two tests run, the history would have commits with messages "initial", "second", "third", "fourth", "fifth", "sixth" and "Second", committed in this order. The commits that does not match either "th" or "Sec" is "second" and "initial". For the case insensitive case only "initial" matches. Signed-off-by: Christoph Junghans <ottxor@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-12for-each-ref: always check stat_tracking_info()'s return valueLibravatar Raphael Kubo da Costa1-0/+13
The code handling %(upstream:track) and %(upstream:trackshort) assumed that it always had a valid branch that had been sanitized earlier in populate_value(), and thus did not check the return value of the call to stat_tracking_info(). While there is indeed some sanitization code that basically corresponds to stat_tracking_info() returning 0 (no base branch set), the function can also return -1 when the base branch did exist but has since then been deleted. In this case, num_ours and num_theirs had undefined values and a call to `git for-each-ref --format="%(upstream:track)"` could print spurious values such as [behind -111794512] [ahead 38881640, behind 5103867] even for repositories with one single commit. Verify stat_tracking_info()'s return value and do not print anything if it returns -1. This behavior also matches the documentation ("has no effect if the ref does not have tracking information associated with it"). Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-12Merge branch 'mg/add-ignore-errors' into maintLibravatar Junio C Hamano1-1/+7
* mg/add-ignore-errors: add: ignore only ignored files
2015-01-12Merge branch 'jk/approxidate-avoid-y-d-m-over-future-dates' into maintLibravatar Junio C Hamano1-0/+3
* jk/approxidate-avoid-y-d-m-over-future-dates: approxidate: allow ISO-like dates far in the future pass TIME_DATE_NOW to approxidate future-check
2015-01-12Merge branch 'jk/for-each-reflog-ent-reverse' into maintLibravatar Junio C Hamano1-0/+30
* jk/for-each-reflog-ent-reverse: for_each_reflog_ent_reverse: turn leftover check into assertion for_each_reflog_ent_reverse: fix newlines on block boundaries
2015-01-12Merge branch 'es/checkout-index-temp'Libravatar Junio C Hamano1-195/+205
"git checkout-index --temp=$target $path" did not work correctly for paths outside the current subdirectory in the project. * es/checkout-index-temp: checkout-index: fix --temp relative path mangling t2004: demonstrate broken relative path printing t2004: standardize file naming in symlink test t2004: drop unnecessary write-tree/read-tree t2004: modernize style
2015-01-12Merge branch 'cc/bisect-rev-parsing'Libravatar Junio C Hamano1-0/+9
The logic in "git bisect bad HEAD" etc. to avoid forcing the test of the common ancestor of bad and good commits was broken. * cc/bisect-rev-parsing: bisect: add test to check that revs are properly parsed bisect: parse revs before passing them to check_expected_revs()
2015-01-08receive-pack: support push-to-checkout hookLibravatar Junio C Hamano1-0/+63
When receive.denyCurrentBranch is set to updateInstead, a push that tries to update the branch that is currently checked out is accepted only when the index and the working tree exactly matches the currently checked out commit, in which case the index and the working tree are updated to match the pushed commit. Otherwise the push is refused. This hook can be used to customize this "push-to-deploy" logic. The hook receives the commit with which the tip of the current branch is going to be updated, and can decide what kind of local changes are acceptable and how to update the index and the working tree to match the updated tip of the current branch. For example, the hook can simply run `git read-tree -u -m HEAD "$1"` in order to emulate 'git fetch' that is run in the reverse direction with `git push`, as the two-tree form of `read-tree -u -m` is essentially the same as `git checkout` that switches branches while keeping the local changes in the working tree that do not interfere with the difference between the branches. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-07t5543-atomic-push.sh: add basic tests for atomic pushesLibravatar Stefan Beller1-0/+194
This adds tests for the atomic push option. The first four tests check if the atomic option works in good conditions and the last three patches check if the atomic option prevents any change to be pushed if just one ref cannot be updated. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-07format-patch: ignore diff.submodule settingLibravatar Doug Kelly1-2/+2
diff.submodule when set to log produces output which git-am cannot handle. Ignore this setting when generating patch output. Signed-off-by: Doug Kelly <dougk.ff7@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-07t4255: test am submodule with diff.submoduleLibravatar Doug Kelly1-0/+72
git am will break when using diff.submodule=log; add some test cases to illustrate this breakage as simply as possible. There are currently two ways this can fail: * With errors ("unrecognized input"), if only change * Silently (no submodule change), if other files change Test for both conditions and ensure without diff.submodule this works. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Doug Kelly <dougk.ff7@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-07Merge branch 'maint'Libravatar Junio C Hamano1-0/+15
* maint: is_hfs_dotgit: loosen over-eager match of \u{..47}
2015-01-07Merge branch 'maint-2.1' into maintLibravatar Junio C Hamano1-0/+15
* maint-2.1: is_hfs_dotgit: loosen over-eager match of \u{..47}
2015-01-07Merge branch 'maint-2.0' into maint-2.1Libravatar Junio C Hamano1-0/+15
* maint-2.0: is_hfs_dotgit: loosen over-eager match of \u{..47}
2015-01-07Merge branch 'maint-1.9' into maint-2.0Libravatar Junio C Hamano1-0/+15
* maint-1.9: is_hfs_dotgit: loosen over-eager match of \u{..47}
2015-01-07Merge branch 'maint-1.8.5' into maint-1.9Libravatar Junio C Hamano1-0/+15
* maint-1.8.5: is_hfs_dotgit: loosen over-eager match of \u{..47}
2015-01-07Merge branch 'jk/dotgit-case-maint-1.8.5' into maint-1.8.5Libravatar Junio C Hamano1-0/+15
* jk/dotgit-case-maint-1.8.5: is_hfs_dotgit: loosen over-eager match of \u{..47}
2015-01-07Merge branch 'bw/maint-0090-awk-tweak'Libravatar Junio C Hamano1-1/+1
* bw/maint-0090-awk-tweak: t0090: tweak awk statement for Solaris /usr/xpg4/bin/awk
2015-01-07Merge branch 'sb/t5400-remove-unused'Libravatar Junio C Hamano1-15/+1
* sb/t5400-remove-unused: t5400: remove dead code
2015-01-07Merge branch 'lh/send-email-hide-x-mailer'Libravatar Junio C Hamano1-0/+33
"git send-email" normally identifies itself via X-Mailer: header in the message it sends out. A new command line flag allows the user to squelch the header. * lh/send-email-hide-x-mailer: test/send-email: --[no-]xmailer tests send-email: add --[no-]xmailer option
2015-01-07Merge branch 'rd/send-email-2047-fix'Libravatar Junio C Hamano1-0/+7
"git send-email" did not handle RFC 2047 encoded headers quite right. * rd/send-email-2047-fix: send-email: handle adjacent RFC 2047-encoded words properly send-email: align RFC 2047 decoding more closely with the spec
2015-01-07Merge branch 'jk/approxidate-avoid-y-d-m-over-future-dates'Libravatar Junio C Hamano1-0/+3
Traditionally we tried to avoid interpreting date strings given by the user as future dates, e.g. GIT_COMMITTER_DATE=2014-12-10 when used early November 2014 was taken as "October 12, 2014" because it is likely that a date in the future, December 10, is a mistake. Loosen this and do not tiebreak by future-ness of the date when (1) ISO-like format is used, and (2) the string can make sense interpreted as both y-m-d and y-d-m. * jk/approxidate-avoid-y-d-m-over-future-dates: approxidate: allow ISO-like dates far in the future pass TIME_DATE_NOW to approxidate future-check
2015-01-07Merge branch 'nd/lockfile-absolute'Libravatar Junio C Hamano1-0/+15
The lockfile API can get confused which file to clean up when the process moved the $cwd after creating a lockfile. * nd/lockfile-absolute: lockfile.c: store absolute path
2015-01-07Merge branch 'jc/strbuf-add-lines-avoid-sp-ht-sequence'Libravatar Junio C Hamano1-0/+6
The commented output used to blindly add a SP before the payload line, resulting in "# \t<indented text>\n" when the payload began with a HT. Instead, produce "#\t<indented text>\n". * jc/strbuf-add-lines-avoid-sp-ht-sequence: strbuf_add_commented_lines(): avoid SP-HT sequence in commented lines
2015-01-07Merge branch 'jc/diff-b-m'Libravatar Junio C Hamano2-3/+4
Fix long-standing bug in "diff -B -M" output. * jc/diff-b-m: diff -B -M: fix output for "copy and then rewrite" case
2015-01-07Merge branch 'jc/clone-borrow'Libravatar Junio C Hamano1-0/+17
Allow "git clone --reference" to be used more safely. * jc/clone-borrow: clone: --dissociate option to mark that reference is only temporary
2015-01-07Merge branch 'jc/checkout-local-track-report'Libravatar Junio C Hamano1-0/+18
The report from "git checkout" on a branch that builds on another local branch by setting its branch.*.merge to branch name (not a full refname) incorrectly said that the upstream is gone. * jc/checkout-local-track-report: checkout: report upstream correctly even with loosely defined branch.*.merge
2015-01-07test-lib.sh: do tests for color support after changing HOMELibravatar Richard Hansen1-43/+47
If ncurses needs ~/.terminfo for the current $TERM, then tput will succeed before changing HOME to $TRASH_DIRECTORY but fail afterward. Move the tests that determine whether there is color support after changing HOME so that color=t is set if and only if tput would succeed when say_color() is run. Note that color=t is now set after --no-color is processed, so the condition to set color=t has changed: it is now set only if color has not already been set to the empty string by --no-color. This disables color support for those that need ~/.terminfo for their TERM, but it's better than filling the screen with: tput: unknown terminal "custom-terminal-name-here" An alternative would be to symlink or copy the user's terminfo database into $TRASH_DIRECTORY, but this is tricky due to the lack of a standard name for the terminfo database (for example, instead of a ~/.terminfo directory, NetBSD uses a ~/.terminfo.cdb database file). Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-07test-lib: use 'test ...' instead of '[ ... ]'Libravatar Richard Hansen1-3/+3
(see Documentation/CodingGuidelines) Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>