<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, branch v2.3.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-02-25T06:10:38Z</updated>
<entry>
<title>Merge branch 'mg/commit-author-no-match-malformed-message' into maint</title>
<updated>2015-02-25T06:10:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-25T06:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7070c03d514a5519a3a4c9dbb47932d522dcb4bd'/>
<id>urn:sha1:7070c03d514a5519a3a4c9dbb47932d522dcb4bd</id>
<content type='text'>
The error message from "git commit", when a non-existing author
name was given as value to the "--author=" parameter, has been
reworded to avoid misunderstanding.

* mg/commit-author-no-match-malformed-message:
  commit: reword --author error message
</content>
</entry>
<entry>
<title>Merge branch 'jk/blame-commit-label' into maint</title>
<updated>2015-02-25T06:09:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-25T06:09:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=faf723a631aff822b4808c496c0970edb0ca2a99'/>
<id>urn:sha1:faf723a631aff822b4808c496c0970edb0ca2a99</id>
<content type='text'>
"git blame HEAD -- missing" failed to correctly say "HEAD" when it
tried to say "No such path 'missing' in HEAD".

* jk/blame-commit-label:
  blame.c: fix garbled error message
  use xstrdup_or_null to replace ternary conditionals
  builtin/commit.c: use xstrdup_or_null instead of envdup
  builtin/apply.c: use xstrdup_or_null instead of null_strdup
  git-compat-util: add xstrdup_or_null helper
</content>
</entry>
<entry>
<title>commit: reword --author error message</title>
<updated>2015-01-27T03:57:12Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2015-01-26T15:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1044b1f6a1a56ae723fd19cddd769380dc775f48'/>
<id>urn:sha1:1044b1f6a1a56ae723fd19cddd769380dc775f48</id>
<content type='text'>
If an --author argument is specified but does not contain a '&gt;' then git tries
to find the argument within the existing authors; and gives the error
message "No existing author found with '%s'" if there is no match.

This is confusing for users who try to specify a valid complete author
name.

Rename the error message to make it clearer that the failure has two
reasons in this case.

(This codepath is touched only when we know already that the argument
cannot be a completely wellformed author ident.)

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/commit.c: use xstrdup_or_null instead of envdup</title>
<updated>2015-01-13T18:03:40Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-13T01:58:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eaa541eb59aefa2c5e9e160c36a259d372c25711'/>
<id>urn:sha1:eaa541eb59aefa2c5e9e160c36a259d372c25711</id>
<content type='text'>
The only reason for envdup to be its own function is that we
have to save the result in a temporary string. With
xstrdup_or_null, we can feed the result of getenv()
directly.

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>Merge branch 'jk/commit-date-approxidate'</title>
<updated>2014-12-22T20:28:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:28:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2df39733e5b07e76ad271c99ff22f5d59a7bf223'/>
<id>urn:sha1:2df39733e5b07e76ad271c99ff22f5d59a7bf223</id>
<content type='text'>
Recent update to "git commit" broke amending an existing commit
with bogus author/committer lines without a valid e-mail address.

* jk/commit-date-approxidate:
  commit: always populate GIT_AUTHOR_* variables
  commit: loosen ident checks when generating template
</content>
</entry>
<entry>
<title>Merge branch 'cc/interpret-trailers-more'</title>
<updated>2014-12-22T20:26:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ed8a4e161c06b82734f5f5268a5b1fb68abb954'/>
<id>urn:sha1:0ed8a4e161c06b82734f5f5268a5b1fb68abb954</id>
<content type='text'>
"git interpret-trailers" learned to properly handle the
"Conflicts:" block at the end.

* cc/interpret-trailers-more:
  trailer: add test with an old style conflict block
  trailer: reuse ignore_non_trailer() to ignore conflict lines
  commit: make ignore_non_trailer() non static
  merge &amp; sequencer: turn "Conflicts:" hint into a comment
  builtin/commit.c: extract ignore_non_trailer() helper function
  merge &amp; sequencer: unify codepaths that write "Conflicts:" hint
  builtin/merge.c: drop a parameter that is never used
</content>
</entry>
<entry>
<title>commit: always populate GIT_AUTHOR_* variables</title>
<updated>2014-12-11T23:34:37Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-10T15:43:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c83a5099c89b83d7678764856f6b6cbf87a69ff0'/>
<id>urn:sha1:c83a5099c89b83d7678764856f6b6cbf87a69ff0</id>
<content type='text'>
To figure out the author ident for a commit, we call
determine_author_info(). This function collects information
from the environment, other commits (in the case of
"--amend" or "-c/-C"), and the "--author" option. It then
uses fmt_ident to generate the final ident string that goes
into the commit object. fmt_ident is therefore responsible
for any quality or validation checks on what is allowed to
go into a commit.

Before returning, though, we call split_ident_line on the
result, and feed the individual components to hooks via the
GIT_AUTHOR_* variables. Furthermore, we do extra validation
by feeding the split to sane_ident_split(), which is pickier
than fmt_ident (in particular, it will complain about an empty
email field).  If this parsing or validation fails, we skip
updating the environment variables.

This is bad, because it means that hooks may silently see a
different ident than what we are putting into the commit. We
should drop the extra sane_ident_split checks entirely, and
take whatever fmt_ident has fed us (and what will go into
the commit object).

If parsing fails, we should actually abort here rather than
continuing (and feeding the hooks bogus data). However,
split_ident_line should never fail here. The ident was just
generated by fmt_ident, so we know that it's sane. We can
use assert_split_ident to double-check this.

Note that we also teach that assertion to check that we
found a date (it always should, but until now, no caller
cared whether we found a date or not). Checking the return
value of sane_ident_split is enough to ensure we have the
name/email pointers set, and checking date_begin is enough
to know that all of the date/tz variables are set.

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: loosen ident checks when generating template</title>
<updated>2014-12-11T23:34:35Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-10T15:42:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fac908389d4571ab5004872a54e50349272b63fc'/>
<id>urn:sha1:fac908389d4571ab5004872a54e50349272b63fc</id>
<content type='text'>
When we generate the commit-message template, we try to
report an author or committer ident that will be of interest
to the user: an author that does not match the committer, or
a committer that was auto-configured.

When doing so, if we encounter what we consider to be a
bogus ident, we immediately die. This is a bad idea, because
our use of the idents here is purely informational.  Any
ident rules should be enforced elsewhere, because commits
that do not invoke the editor will not even hit this code
path (e.g., "git commit -mfoo" would work, but "git commit"
would not). So at best, we are redundant with other checks,
and at worse, we actively prevent commits that should
otherwise be allowed.

We should therefore do the minimal parsing we can to get a
value and not do any validation (i.e., drop the call to
sane_ident_split()).

In theory we could notice when even our minimal parsing
fails to work, and do the sane thing for each check (e.g.,
if we have an author but can't parse the committer, assume
they are different and print the author). But we can
actually simplify this even further.

We know that the author and committer strings we are parsing
have been generated by us earlier in the program, and
therefore they must be parseable. We could just call
split_ident_line without even checking its return value,
knowing that it will put _something_ in the name/mail
fields. Of course, to protect ourselves against future
changes to the code, it makes sense to turn this into an
assert, so we are not surprised if our assumption fails.

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: make ignore_non_trailer() non static</title>
<updated>2014-11-10T17:59:19Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2014-11-09T09:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c3845892363abf3fb5cf2fe61bc455554f50c68'/>
<id>urn:sha1:8c3845892363abf3fb5cf2fe61bc455554f50c68</id>
<content type='text'>
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/conflict-hint' into cc/interpret-trailers-more</title>
<updated>2014-11-10T17:56:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-11-10T17:56:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=216d29ef257e48f95bc14765d5da17e7854a3109'/>
<id>urn:sha1:216d29ef257e48f95bc14765d5da17e7854a3109</id>
<content type='text'>
* jc/conflict-hint:
  merge &amp; sequencer: turn "Conflicts:" hint into a comment
  builtin/commit.c: extract ignore_non_trailer() helper function
  merge &amp; sequencer: unify codepaths that write "Conflicts:" hint
  builtin/merge.c: drop a parameter that is never used
  git-tag.txt: Add a missing hyphen to `-s`
</content>
</entry>
</feed>
