summaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
AgeCommit message (Collapse)AuthorFilesLines
2009-03-25t7502-commit: Skip SIGTERM test on WindowsLibravatar Johannes Sixt1-1/+1
The implementation of exec on Windows is just a rough approximation of the POSIX behavior. In particular, no real process "overlay" happens (a new process is spawned instead and the parent process waits until the child terminates). In particular, the process ID cannot be taken by the exec'd process. But there is one test in t7502-commit.sh that depends on this. We have to skip it on Windows. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2008-10-26wt-status: load diff ui configLibravatar Jeff King1-0/+8
When "git status -v" shows a diff, we did not respect the user's usual diff preferences at all. Loading just git_diff_basic_config would give us things like rename limits and diff drivers. But it makes even more sense to load git_diff_ui_config, which gives us colorization if the user has requested it. Note that we need to take special care to cancel colorization when writing to the commit template file, as described in the code comments. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-31Compact commit template messageLibravatar Jeff King1-6/+5
We recently let the user know explicitly that an empty commit message will abort the commit. However, this adds yet another line to the template; let's rephrase and re-wrap so that this fits back on two lines. This patch also makes the "fatal: empty commit message?" warning a bit less scary, since this is now a "feature" instead of an error. However, we retain the non-zero exit status to indicate to callers that nothing was committed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-30Advertise the ability to abort a commitLibravatar Anders Melchiorsen1-3/+4
This treats aborting a commit more like a feature. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23t7502-commit.sh: rearrange test to make more portableLibravatar Brandon Casey1-3/+5
Some shells have problems with one-shot environment variable export and function calls. The sequence is rearranged to avoid the one-shot and to allow the test script to be linked together with '&&'. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19t7502-commit.sh: test_must_fail doesn't work with inline environment variablesLibravatar Brandon Casey1-1/+5
When the arguments to test_must_fail() begin with a variable assignment, test_must_fail() attempts to execute the variable assignment as a command. This fails, and so test_must_fail returns with a successful status value without running the command it was intended to test. For example, the following script: #!/bin/sh test_must_fail () { "$@" test $? -gt 0 -a $? -le 129 } foo='wo adrian' test_must_fail foo='yo adrian' sh -c 'echo foo: $foo' always exits zero and prints the message: test.sh: line 3: foo=yo adrian: command not found Test 16 calls test_must_fail in such a way and therefore has not been testing whether git 'do[es] not fire editor in the presence of conflicts'. A workaround is to set and export the variable in a normal way, not using one-shot notation. Because this would affect the remainder of the process, the test is done inside a subshell. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-04t7502: honor SHELL_PATHLibravatar Junio C Hamano1-3/+3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-03t7502: tighten loosely written test sequenceLibravatar Junio C Hamano1-17/+18
We would like to catch breakage at any step in the sequence. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-03t7502: do not globally unset GIT_COMMITTER_* environment variablesLibravatar Junio C Hamano1-3/+6
One particular test wants to check the behaviour of the command when these variables are not set, but the later tests should have the reliable committer identity for repeatable tests. Move the "unset" of the variables inside a subshell in the test that wants to unset them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-02commit: drop duplicated parentsLibravatar Junio C Hamano1-0/+14
The scripted version of git-commit internally used git-commit-tree which omitted duplicated parents given from the command line. This prevented a nonsensical octopus merge from getting created even when you said "git merge A B" while you are already on branch A. However, when git-commit was rewritten in C, this sanity check was lost. This resurrects it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-31rollback lock files on more signals than just SIGINTLibravatar Paolo Bonzini1-0/+14
Other signals are also common, for example SIGTERM and SIGHUP. This patch modifies the lock file mechanism to catch more signals. It also modifies http-push.c which was missing SIGTERM. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-16Replace in-place sed in t7502-commitLibravatar Marcel Koeppen1-1/+3
The in-place mode of sed used in t7502-commit is a non-POSIX extension. That call of sed is replaced by a more portable version using a temporary file. Signed-off-by: Marcel Koeppen <git-dev@marzelpan.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06commit: Show committer if automaticLibravatar Santi Béjar1-0/+15
To warn the user in case he/she might be using an unintended committer identity. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06commit: Show author if different from committerLibravatar Santi Béjar1-0/+12
That would help reassure anybody while committing other's changes. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13add test_cmp function for test scriptsLibravatar Jeff King1-7/+7
Many scripts compare actual and expected output using "diff -u". This is nicer than "cmp" because the output shows how the two differ. However, not all versions of diff understand -u, leading to unnecessary test failure. This adds a test_cmp function to the test scripts and switches all "diff -u" invocations to use it. The function uses the contents of "$GIT_TEST_CMP" to compare its arguments; the default is "diff -u". On systems with a less-capable diff, you can do: GIT_TEST_CMP=cmp make test Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-06git-commit: Refactor creation of log message.Libravatar Paolo Bonzini1-0/+29
This patch moves the code of run_commit, up to writing the trees, editing the message and running the commit-msg hook to prepare_log_message. It also renames the latter to prepare_to_commit. This simplifies a little the code for the next patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-22Allow selection of different cleanup modes for commit messagesLibravatar Alex Riesen1-0/+65
Although we traditionally stripped away excess blank lines, trailing whitespaces and lines that begin with "#" from the commit log message, sometimes the message just has to be the way user wants it. For instance, a commit message template can contain lines that begin with "#", the message must be kept as close to its original source as possible if you are converting from a foreign SCM, or maybe the message has a shell script including its comments for future reference. The cleanup modes are default, verbatim, whitespace and strip. The default mode depends on if the message is being edited and will either strip whitespace and comments (if editor active) or just strip the whitespace (for where the message is given explicitely). Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-22Add a few more tests for git-commitLibravatar Junio C Hamano1-0/+92
Signed-off-by: Junio C Hamano <gitster@pobox.com>