git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH 2/2] git-patch-id: do not trip over "no newline" markers
Date: Wed, 16 Feb 2011 12:05:57 -0800	[thread overview]
Message-ID: <7vwrkziw2i.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <144f7a4824abecaf87f862ed9e60587456128b41.1297875236.git.git@drmicha.warpmail.net> (Michael J. Gruber's message of "Wed\, 16 Feb 2011 17\:55\:38 +0100")

Michael J Gruber <git@drmicha.warpmail.net> writes:

> Currently, patch-id trips over our very own diff extension for marking
> the absence of newline at EOF.
>
> Fix it. (Ignore it, it's whitespace.)
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
>  builtin/patch-id.c  |    2 ++
>  t/t4204-patch-id.sh |    2 +-
>  2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/patch-id.c b/builtin/patch-id.c
> index 5125300..653d958 100644
> --- a/builtin/patch-id.c
> +++ b/builtin/patch-id.c
> @@ -73,6 +73,8 @@ int get_one_patchid(unsigned char *next_sha1, git_SHA_CTX *ctx)
>  			p += 7;
>  		else if (!memcmp(line, "From ", 5))
>  			p += 5;
> +		else if (!memcmp(line, "\\ No newline at end of file", 27))
> +			continue;

Good spotting, except that this string is a bit too specific to git and
GNU diff run in the C or ??_en locales.  An early draft of "git apply"
used to have the same string but the string was removed before the command
was released to the wild with a lot weaker condition (grep for "l10n" in
builtin/apply.c).

  reply	other threads:[~2011-02-16 20:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 14:56 Why does git-patch-id(1) sometimes print two lines, one of which has commit = 0000000000000000000000000000000000000000 Ævar Arnfjörð Bjarmason
2011-02-16 16:11 ` Michael J Gruber
2011-02-16 16:55   ` [PATCH 1/2] git-patch-id: test for "no newline" markers Michael J Gruber
2011-02-16 16:55     ` [PATCH 2/2] git-patch-id: do not trip over " Michael J Gruber
2011-02-16 20:05       ` Junio C Hamano [this message]
2011-02-17  7:44         ` [PATCHv2 1/2] git-patch-id: test for " Michael J Gruber
2011-02-17  7:44           ` [PATCHv2 2/2] git-patch-id: do not trip over " Michael J Gruber
2011-02-18  4:16             ` Jeff King
2011-02-18  8:02               ` Michael J Gruber
2011-02-18 10:12                 ` [PATCHv3 1/2] git-patch-id: test for " Michael J Gruber
2011-02-18 10:12                   ` [PATCHv3 2/2] git-patch-id: do not trip over " Michael J Gruber
2011-02-18 10:41                     ` Jeff King
2011-02-18 10:43                       ` Michael J Gruber
2011-02-18 10:47                         ` Jeff King
2011-02-18 14:29                     ` Jakub Narebski
2011-02-18 10:40                 ` [PATCHv2 " Jeff King
2011-02-17 11:55           ` [PATCHv2 1/2] git-patch-id: test for " Jakub Narebski
2011-02-17 12:11             ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vwrkziw2i.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).