<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7501-commit.sh, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2012-07-16T04:39:48Z</updated>
<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>
<entry>
<title>commit: rephrase the error when user did not touch templated log message</title>
<updated>2012-03-30T19:20:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-03-30T19:14:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2eda9bdfbacdd3bb52da2ebcb468415cf153940'/>
<id>urn:sha1:b2eda9bdfbacdd3bb52da2ebcb468415cf153940</id>
<content type='text'>
When the user exited editor without editing the commit log template given
by "git commit -t &lt;template&gt;", the commit was aborted (correct) with an
error message that said "due to empty commit message" (incorrect).

This was because the original template support was done by piggybacking on
the check to detect an empty log message.  Split the codepaths into two
independent checks to clarify the error.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: do not trigger bogus "has templated message edited" check</title>
<updated>2012-03-30T18:30:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-03-30T18:30:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0'/>
<id>urn:sha1:010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0</id>
<content type='text'>
When "-t template" and "-F msg" options are both given (or worse yet,
there is "commit.template" configuration but a message is given in some
other way), the documentation says that template is ignored.  However,
the "has the user edited the message?" check still used the contents of
the template file as the basis of the emptyness check.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7501: test the right kind of breakage</title>
<updated>2012-03-30T18:07:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-03-30T18:04:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c65dc351f0ae184f69cbc0b6555ff19aacb70e01'/>
<id>urn:sha1:c65dc351f0ae184f69cbc0b6555ff19aacb70e01</id>
<content type='text'>
These tests try to run "git commit" with various "forbidden" combinations
of options and expect the command to fail, but they do so without having
any change added to the index.  We wouldn't be able to catch breakages
that would allow these combinations by mistake with them because the
command will fail with "nothing to commit" anyway.

Make sure we have something added to the index before running the command.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test: commit --amend should honor --no-edit</title>
<updated>2011-12-08T23:35:34Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2011-12-07T14:54:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc8218999863a083d725f2011e5e0371df30aa1f'/>
<id>urn:sha1:bc8218999863a083d725f2011e5e0371df30aa1f</id>
<content type='text'>
A quick test to make sure git doesn't lose the functionality added by
the recent patch "commit: honor --no-edit", plus another test to check
the classical --edit use case (use with "-m").

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