summaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
AgeCommit message (Collapse)AuthorFilesLines
2010-11-09tests: add missing &&, batch 2Libravatar Jonathan Nieder1-1/+1
Same rules as before: this patch only adds " &&" to the end of some lines in the test suite. Intended to be applied on top of or squashed with the last batch if they look okay. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06Introduce sane_unset and use it to ensure proper && chainingLibravatar Elijah Newren1-2/+2
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-21Merge branch 'tc/commit-abbrev-fix'Libravatar Junio C Hamano1-0/+68
* tc/commit-abbrev-fix: commit::print_summary(): don't use format_commit_message() t7502-commit: add summary output tests for empty and merge commits t7502-commit: add tests for summary output
2010-06-13commit::print_summary(): don't use format_commit_message()Libravatar Tay Ray Chuan1-2/+2
This attempts to fix a regression in git-commit, where non-abbreviated SHA-1s were printed in the summary. One possible fix would be to set ctx.abbrev to DEFAULT_ABBREV in the `if` block, where format_commit_message() is used. Instead, we do away with the format_commit_message() codeblock altogether, replacing it with a re-run of log_tree_commit(). We re-run log_tree_commit() with rev.always_show_header set, to force the invocation of show_log(). The effect of this flag can be seen from this excerpt from log-tree.c:560, the only area that rev.always_show_header is checked: shown = log_tree_diff(opt, commit, &log); if (!shown && opt->loginfo && opt->always_show_header) { log.parent = NULL; show_log(opt); shown = 1; } We also set rev.use_terminator, so that a newline is appended at the end of the log message. Note that callers in builtin/log.c that also set rev.always_show_header don't have to set rev.use_terminator, but still get a newline, because they are wrapped in a pager. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28t7502-commit: add summary output tests for empty and merge commitsLibravatar Tay Ray Chuan1-2/+27
After c197702 (pretty: Respect --abbrev option), non-abbreviated hashes began to appear, leading to failures for these tests. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28t7502-commit: add tests for summary outputLibravatar Tay Ray Chuan1-0/+43
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-25t7502-commit: fix spellingLibravatar Tay Ray Chuan1-1/+1
s/subdirecotry/subdirectory/ Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-13t7502: test commit.status, --status and --no-statusLibravatar Junio C Hamano1-0/+109
Make sure that the status information: - is shown as before without configuration nor command line option; - is shown if commit.status is set to true and no command line option is given, or --status is explicitly given; - is not shown if commit.status is set to false and no command line option is given, or --no-status is explicitly given. Also make sure that the way lines taken from the custom --template appear in the log message editor is not changed at all. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-06builtin-commit.c: fix logic to omit empty line before existing footersLibravatar Junio C Hamano1-0/+9
"commit -s" used to add an empty line before adding S-o-b line only when the last line of the existing log message is not another S-o-b line, but c1e01b0 (commit: More generous accepting of RFC-2822 footer lines., 2009-10-28) introduced logic to omit this empty line when the message ends with a run of "footer" lines, to cover S-o-b's friends, e.g. Acked-by. However, the logic was overzealous and missed one corner case. A message that consists of a single line that begins with Token + colon, it can be mistaken as a S-o-b's friend. We do want an empty line in such a case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
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>