<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7501-commit.sh, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-05-23T21:54:28Z</updated>
<entry>
<title>Merge branch 'ss/commit-dry-run-resolve-merge-to-no-op'</title>
<updated>2016-05-23T21:54:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-23T21:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ce2824e4ba56bf0f2017a0e351fa35c22a705ac'/>
<id>urn:sha1:9ce2824e4ba56bf0f2017a0e351fa35c22a705ac</id>
<content type='text'>
"git commit --dry-run" reported "No, no, you cannot commit." in one
case where "git commit" would have allowed you to commit, and this
improves it a little bit ("git commit --dry-run --short" still does
not give you the correct answer, for example).  This is a stop-gap
measure in that "commit --short --dry-run" still gives an incorrect
result.

* ss/commit-dry-run-resolve-merge-to-no-op:
  wt-status.c: set commitable bit if there is a meaningful merge.
</content>
</entry>
<entry>
<title>commit: do not ignore an empty message given by -m ''</title>
<updated>2016-04-07T20:25:12Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-04-07T19:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27014cbc04e369624f6c1754b72ef4eddb911166'/>
<id>urn:sha1:27014cbc04e369624f6c1754b72ef4eddb911166</id>
<content type='text'>
When f9568530 (builtin-commit: resurrect behavior for multiple -m
options, 2007-11-11) converted a "char *message" to "struct strbuf
message" to hold the messages given with the "-m" option, it
incorrectly changed the checks "did we get a message with the -m
option?" to "is message.len 0?".  Later, we noticed one breakage
from this change and corrected it with 25206778 (commit: don't start
editor if empty message is given with -m, 2013-05-25).

However, "we got a message with -m, even though an empty one, so we
shouldn't be launching an editor" was not the only breakage.

 * "git commit --amend -m '' --allow-empty", even though it looks
   strange, is a valid request to amend the commit to have no
   message at all.  Due to the misdetection of the presence of -m on
   the command line, we ended up keeping the log messsage from the
   original commit.

 * "git commit -m "$msg" -F file" should be rejected whether $msg is
   an empty string or not, but due to the same bug, was not rejected
   when $msg is empty.

 * "git -c template=file -m "$msg"" should ignore the template even
   when $msg is empty, but it didn't and instead used the contents
   from the template file.

Correct these by checking have_option_m, which the earlier 25206778
introduced to fix the same bug.

Reported-by: Adam Dinwoodie &lt;adam@dinwoodie.org&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: --amend -m '' silently fails to wipe message</title>
<updated>2016-04-07T20:21:43Z</updated>
<author>
<name>Adam Dinwoodie</name>
<email>adam@dinwoodie.org</email>
</author>
<published>2016-04-06T17:15:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=178e8143b4f79290b3ffe40fe2ebf769fccc1ab7'/>
<id>urn:sha1:178e8143b4f79290b3ffe40fe2ebf769fccc1ab7</id>
<content type='text'>
`git commit --amend -m ''` seems to be an unambiguous request to blank a
commit message, but it actually leaves the commit message as-is.  That's
the case regardless of whether `--allow-empty-message` is specified, and
doesn't so much as drop a non-zero return code.

Add failing tests to show this behaviour.

Signed-off-by: Adam Dinwoodie &lt;adam@dinwoodie.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wt-status.c: set commitable bit if there is a meaningful merge.</title>
<updated>2016-02-17T16:53:11Z</updated>
<author>
<name>Stephen P. Smith</name>
<email>ischis2@cox.net</email>
</author>
<published>2016-02-16T02:38:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8dc874b2ee61f0c457c4482ed2f202cac55b52ad'/>
<id>urn:sha1:8dc874b2ee61f0c457c4482ed2f202cac55b52ad</id>
<content type='text'>
The 'commit --dry-run' and 'commit' return values differed if a
conflicted merge had been resolved and the resulting commit would
record the same tree as the parent.

Update show_merge_in_progress to set the commitable bit if conflicts
have been resolved and a merge is in progress.

Signed-off-by: Stephen P. Smith &lt;ischis2@cox.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: accept more date formats for "--date"</title>
<updated>2014-05-02T21:15:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-02T01:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=14ac2864dcd566a025e449ab9db6b5dc57744a32'/>
<id>urn:sha1:14ac2864dcd566a025e449ab9db6b5dc57744a32</id>
<content type='text'>
Right now we pass off the string found by "--date" straight
to the fmt_ident function, which will use our strict
parse_date to normalize it. However, this means obvious
things like "--date=now" or "--date=2.days.ago" will not
work.

Instead, let's fallback to the approxidate function to
handle this for us. Note that we must try parse_date
ourselves first, even though approxidate will try strict
parsing itself. The reason is that approxidate throws away
any timezone information it sees from the strict parsing,
and we want to preserve it. So asking for:

  git commit --date="@1234567890 -0700"

continues to set the date in -0700, regardless of what the
local timezone is.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: print "Date" line when the user has set date</title>
<updated>2014-05-02T21:14:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-02T01:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7242b8c9e4b3c57a07c2a76d0337389605aadcc'/>
<id>urn:sha1:b7242b8c9e4b3c57a07c2a76d0337389605aadcc</id>
<content type='text'>
When we make a commit and the author is not the same as the
committer (e.g., because you used "-c $commit" or
"--author=$somebody"), we print the author's name and email
in both the commit-message template and as part of the
commit summary. This is a safety check to give the user a
chance to confirm that we are doing what they expect.

This patch brings the same safety for the "date" field,
which may be set by "-c" or by using "--date".  Note that we
explicitly do not set it for $GIT_AUTHOR_DATE, as it is
probably not of interest when "git commit" is being fed its
parameters by a script.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>demonstrate git-commit --dry-run exit code behaviour</title>
<updated>2014-02-24T17:16:53Z</updated>
<author>
<name>Tay Ray Chuan</name>
<email>rctay89@gmail.com</email>
</author>
<published>2014-02-21T19:16:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9cbcc2a7ca5b09ff57b52b7f6e422228f6cfd451'/>
<id>urn:sha1:9cbcc2a7ca5b09ff57b52b7f6e422228f6cfd451</id>
<content type='text'>
In particular, show that --short and --porcelain, while implying
--dry-run, do not return the same exit code as --dry-run. This is due to
the wt_status.commitable flag being set only when a long status is
requested.

No fix is provided here; with [1], it should be trivial to fix though -
just a matter of calling wt_status_mark_commitable().

[1] http://article.gmane.org/gmane.comp.version-control.git/242489

Signed-off-by: Tay Ray Chuan &lt;rctay89@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7501: fix "empty commit" test with NO_PERL</title>
<updated>2014-01-23T21:11:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-01-23T19:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=088304bf73b9b4149e04d2246fe08a06eef6e795'/>
<id>urn:sha1:088304bf73b9b4149e04d2246fe08a06eef6e795</id>
<content type='text'>
t7501.9 tries to check that "git commit" will fail when the
index is unchanged. It relies on previous tests not to have
modified the index. When it was originally written, this was
always the case. However, commit c65dc35 (t7501: test the
right kind of breakage, 2012-03-30) changed earlier tests (4
and 5) to leave a modification in the index.

We never noticed, however, because t7501.7, between the two,
clears the index state as a side effect. However, that test
depends on the PERL prerequisite, and so it does not always
run. Therefore if NO_PERL is set, we do not run the
intervening test, the index is left unclean, and t7501.9
fails.

We could fix this by moving t7501.9 up in the script.
However, this patch instead leaves it in place and adds a
"git reset" before the commit. This makes the test more
explicit about its preconditions, and will future-proof it
against any other changes in the test state.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Make test "using invalid commit with -C" more strict</title>
<updated>2013-08-25T06:58:43Z</updated>
<author>
<name>Kacper Kornet</name>
<email>draenog@pld-linux.org</email>
</author>
<published>2013-08-24T04:01:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0bb0c15533c52bfb6f7a5174265869b808faf7ee'/>
<id>urn:sha1:0bb0c15533c52bfb6f7a5174265869b808faf7ee</id>
<content type='text'>
In the test 'using invalid commit with -C' git-commit would have failed
even if the -C option had been given the correct commit, as there was
nothing to commit. Pass --allow-empty to make sure it would make a commit,
were there no issues with the argument given to the -C option.

Signed-off-by: Kacper Kornet &lt;draenog@pld-linux.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Test 'commit --only' after 'checkout --orphan'</title>
<updated>2013-06-02T19:31:17Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@inf.ethz.ch</email>
</author>
<published>2013-06-01T11:02:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0c73200e86b6166596f45ce32b7f04291074182'/>
<id>urn:sha1:f0c73200e86b6166596f45ce32b7f04291074182</id>
<content type='text'>
There are some index handling subtleties in 'commit --only' that are
best tested when we have an existing index, but an unborn or empty
HEAD.  These circumstances are easily produced by 'checkout --orphan',
but we did not previously have a test for it.

The main expected failure mode would be: erroneously loading the
existing index contents when building the temporary index that is used
for --only.  Cf.

  http://article.gmane.org/gmane.comp.version-control.git/225969

and subsequent discussion.

Signed-off-by: Thomas Rast &lt;trast@inf.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
