<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7501-commit.sh, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-02-24T17:16:53Z</updated>
<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>
<entry>
<title>Allow edit of empty message with commit --amend</title>
<updated>2012-07-09T19:43:58Z</updated>
<author>
<name>Chris Webb</name>
<email>chris@arachsys.com</email>
</author>
<published>2012-07-09T18:53:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9a93575722d9ea918f090892b06618ddf0d1d65'/>
<id>urn:sha1:d9a93575722d9ea918f090892b06618ddf0d1d65</id>
<content type='text'>
"git commit --amend" used on a commit with an empty message fails
unless -m is given, whether or not --allow-empty-message is
specified.

Allow it to proceed to the editor with an empty commit message.
Unless --allow-empty-message is in force, it will still abort later
if an empty message is saved from the editor (this check was
already necessary to prevent a non-empty commit message being edited
to an empty one).

Add a test for --amend --edit of an empty commit message which fails
without this fix, as it's a rare case that won't get frequently
tested otherwise.

Signed-off-by: Chris Webb &lt;chris@arachsys.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-index.c: "git diff" has no need to read blob from the standard input</title>
<updated>2012-06-28T23:18:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-06-28T03:14:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4682d8521c3ce9d722bd214fd7d5fc92063fdacb'/>
<id>urn:sha1:4682d8521c3ce9d722bd214fd7d5fc92063fdacb</id>
<content type='text'>
Only "diff --no-index -" does.  Bolting the logic into the low-level
function diff_populate_filespec() was a layering violation from day
one.  Move populate_from_stdin() function out of the generic diff.c
to its only user, diff-index.c.

Also make sure "-" from the command line stays a special token "read
from the standard input", even if we later decide to sanitize the
result from prefix_filename() function in a few obvious ways,
e.g. removing unnecessary "./" prefix, duplicated slashes "//" in
the middle, etc.

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