Re: git-diff-files -z output

4 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git-diff-files -z output

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:58

quoted
quoted
quoted
quoted
"TG" == Thomas Glanzmann [off-list ref] writes:
TG> I am adopting to the new format.
TG> Are the fields supposed to be seperated by space or tab?

Please see Documentation/diff-format.txt; find the below in the
archive for the full description of why we wanted this format
update.

    From:	Junio C Hamano [off-list ref]
    Subject: Re: updated design for the diff-raw format.
    To:	git@vger.kernel.org
    Date:	Sat, 21 May 2005 16:17:33 -0700

    (second of the replayed message, with blessing from Linus)

    Date: Sat, 21 May 2005 11:24:31 -0700 (PDT)
    From: Linus Torvalds [off-list ref]
    To: Junio C Hamano [off-list ref]
    Subject: Re: [PATCH 3/3] Diff overhaul, adding the other half of copy detection.
    Message-ID: [off-list ref]

    On Sat, 21 May 2005, Junio C Hamano wrote:
    > 
    > Once we start to think of it this way, it becomes quite tempting
    > to change the diff-raw format to actually match the above
    > concept.

    I agree, and I was going to suggest changing the "raw" diff output for all
    the same reasons. So I think you should do it, as the old format was based
    on not really knowing where this all would take us. I think your proposed
    format is visually nicer, and it's obviously more flexible.

Re: git-diff-files -z output

From: Thomas Glanzmann <hidden>
Date: 2016-06-15 22:41:58

Hello,
Please see Documentation/diff-format.txt; find the below in the
archive for the full description of why we wanted this format
update.
got it thanks. I read that eMail before. But I thought that the
tab -> space was a mistake, but it wasn't. So I am fine. I use the
following code fragment to match it. Gitweb and co have to be adopted as
well:

sub
process_git_diff_output
{
        my $str = shift || die("Need Input");

        my @in  = split("\0", $str);
        my @out = ();

        while (@in) {
                my @tmp = split(' ', shift(@in));
                push(@tmp, shift(@in), shift(@in));
                push(@out, [@tmp]);
        }

        return(@out);
}

	Thomas

Re: git-diff-files -z output

From: Thomas Glanzmann <hidden>
Date: 2016-06-15 22:41:58

Hello,
this is better (it strips the colon from the first mode):

sub
process_git_diff_output
{
        my $str = shift || die("Need Input");

        my @in  = split("\0", $str);
        my @out = ();

        while (@in) {
                my @tmp = split(' ', shift(@in));
                $tmp[0] =~ s/^://g;
                push(@tmp, shift(@in), shift(@in));
                push(@out, [@tmp]);
        }

        return(@out);
}

	Thomas

Re: git-diff-files -z output

From: Thomas Glanzmann <hidden>
Date: 2016-06-15 22:41:58

Hello,
                $tmp[0] =~ s/^://g;
                                   ^ -> This is useless.

	Thomas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help