All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: DOAN Tran Cong Danh <congdanhqx@gmail.com>,
	git@vger.kernel.org, animi.vulpis@gmail.com, j6t@kdbg.org,
	Karthik Nayak <karthik.188@gmail.com>
Subject: Re: [PATCH] ref-filter: treat CRLF as same as LF in find_subpos
Date: Tue, 23 May 2017 11:01:15 +0900	[thread overview]
Message-ID: <xmqq37bwnxg4.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170522201212.uuas26n6npdebsxg@sigill.intra.peff.net> (Jeff King's message of "Mon, 22 May 2017 16:12:12 -0400")

Jeff King <peff@peff.net> writes:

> I suspect that's more work because we'd need to refactor pretty.c a bit
> to make the right functionality available. But the end result would be
> much more maintainable.

I actually think the entire codeflow of "find positions and length
of threeparts" using find_subpos() and then "copy the length bytes
starting position for C_{SUB,BODY,SIG,LINES,...}" must be rethought,
if the behavior of pretty.c::pretty_print_commit() is to be matched.
With the current code, %(contents:body) and other atoms that are
handled in ref-filter.c::grab_sub_body_contents() keep trailing
whitespaces on their lines with the current code that copies length
bytes starting the position using xmemdupz().  There need to be some
code that loses these trailing whiltespaces in the copied result.

While I do not claim that refactoring and reusing code from pretty.c
is the only viable way forward, it is clear to me that a patch that
updates find_subpos() and changes nothing else falls short X-<.


  parent reply	other threads:[~2017-05-23  2:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 23:22 [Bug] git branch -v has problems with carriage returns Animi Vulpis
     [not found] ` <CA+izobutP-JY84RGG-JbPA5twbckL1uVwxknBRLVTuGG0MEJcg@mail.gmail.com>
     [not found]   ` <CA+izobuSKtoQzNJuvuisjh7h3FF=nbt8u-hOHfdeFp8ZjgZF+Q@mail.gmail.com>
     [not found]     ` <591f6844.82dcca0a.451e5.8f76.GMRIR@mx.google.com>
2017-05-19 21:51       ` Delivery Status Notification (Failure) Atousa Duprat
2017-05-19 21:55 ` [Bug] git branch -v has problems with carriage returns Atousa Duprat
2017-05-19 23:20   ` Animi Vulpis
2017-05-20  6:48   ` Johannes Sixt
2017-05-31  5:32     ` Atousa Duprat
2017-05-31 20:58       ` Stefan Beller
2017-06-01  1:31       ` Junio C Hamano
2017-05-21 13:42   ` [PATCH] ref-filter: treat CRLF as same as LF in find_subpos DOAN Tran Cong Danh
2017-05-22  1:19     ` Junio C Hamano
2017-05-22 11:29       ` DOAN Tran Cong Danh
2017-05-22 20:12       ` Jeff King
2017-05-23  1:49         ` Junio C Hamano
2017-05-23  2:01         ` Junio C Hamano [this message]
2017-05-23  3:01           ` Junio C Hamano
2017-05-21 14:10 ` DOAN Tran Cong Danh
2017-05-22 14:57   ` [PATCH v2] ref-filter: trim end whitespace in subject DOAN Tran Cong Danh
2017-05-22 17:10     ` [PATCH v3] " DOAN Tran Cong Danh
2017-05-22 19:47       ` Johannes Sixt
2017-05-22 19:53         ` Jeff King
2017-05-22 20:19           ` Johannes Sixt

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

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

  git send-email \
    --in-reply-to=xmqq37bwnxg4.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=animi.vulpis@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=karthik.188@gmail.com \
    --cc=peff@peff.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.