<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7501-commit.sh, branch v2.3.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-05-02T21:15:22Z</updated>
<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>
<entry>
<title>Merge branch 'jk/maint-commit-amend-only-no-paths'</title>
<updated>2012-07-16T04:39:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-07-16T04:39:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9a0801ad0222256e2ddbf38d8bcce9f32e0211c'/>
<id>urn:sha1:b9a0801ad0222256e2ddbf38d8bcce9f32e0211c</id>
<content type='text'>
"git commit --amend --only --" was meant to allow "Clever" people to
rewrite the commit message without making any change even when they
have already changes for the next commit added to their index, but
it never worked as advertised since it was introduced in 1.3.0 era.

* jk/maint-commit-amend-only-no-paths:
  commit: fix "--amend --only" with no pathspec
</content>
</entry>
<entry>
<title>Merge branch 'cw/amend-commit-without-message'</title>
<updated>2012-07-16T04:39:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-07-16T04:39:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8647b585d899bc7458fbc5c12c2c44331da5b4c0'/>
<id>urn:sha1:8647b585d899bc7458fbc5c12c2c44331da5b4c0</id>
<content type='text'>
"commit --amend" used to refuse amending a commit with an empty log
message, with or without "--allow-empty-message".

* cw/amend-commit-without-message:
  Allow edit of empty message with commit --amend
</content>
</entry>
<entry>
<title>Merge branch 'jc/refactor-diff-stdin'</title>
<updated>2012-07-13T22:38:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-07-13T22:38:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7afe648dcb188557173c239a337e123ec22cd1b'/>
<id>urn:sha1:d7afe648dcb188557173c239a337e123ec22cd1b</id>
<content type='text'>
Due to the way "git diff --no-index" is bolted onto by touching the
low level code that is shared with the rest of the "git diff" code,
even though it has to work in a very different way, any comparison
that involves a file "-" at the root level incorrectly tried to read
from the standard input.  This cleans up the no-index codepath
further to remove code that reads from the standard input from the
core side, which is never necessary when git is running its usual
diff operation.

* jc/refactor-diff-stdin:
  diff-index.c: "git diff" has no need to read blob from the standard input
  diff-index.c: unify handling of command line paths
  diff-index.c: do not pretend paths are pathspecs
</content>
</entry>
<entry>
<title>commit: fix "--amend --only" with no pathspec</title>
<updated>2012-07-10T21:16:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-07-10T20:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea2d4ed35902ce15959965ab86d80527731a177c'/>
<id>urn:sha1:ea2d4ed35902ce15959965ab86d80527731a177c</id>
<content type='text'>
When we do not have any pathspec, we typically disallow an
explicit "--only", because it makes no sense (your commit
would, by definition, be empty). But since 6a74642
(git-commit --amend: two fixes., 2006-04-20), we have
allowed "--amend --only" with the intent that it would amend
the commit, ignoring any contents staged in the index.

However, while that commit allowed the combination, we never
actually implemented the logic to make it work. The current
code notices that we have no pathspec and assumes we want to
do an as-is commit (i.e., the "--only" is ignored).

Instead, we must make sure to follow the partial-commit
code-path. We also need to tweak the list_paths function to
handle a NULL pathspec.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
