git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] diff -B does not (always?) use colors
@ 2007-02-20 10:08 Matthias Lederhofer
  2007-02-20 14:08 ` [PATCH] Teach diff -B about colours Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Lederhofer @ 2007-02-20 10:08 UTC (permalink / raw)
  To: git

I found that git diff -B does not always use colors and I don't have
time to figure out what it is atm.

The bug can be triggered by this two files and running git diff with
-B.  You can also just clone the repository from
git://igit.ath.cx/~matled/tmp/break/

% git cat-file -p HEAD~1:test
def test(p)
    if p
        Array.new
        Array.new(2)
        Array.new(5, "A")

        # only one copy of the object is created
        a = Array.new(2, Hash.new)
        a[0]['cat'] = 'feline'
        a
        a[1]['cat'] = 'Felix'
        a

        # here multiple copies are created
        a = Array.new(2) { Hash.new }
        a[0]['cat'] = 'feline'
        a

        squares = Array.new(5) {|i| i*i}
        squares

        copy = Array.new(squares)
    end
end
% git cat-file -p HEAD:test  
def test(p)
    test_bla if p
end

def test_bla
    Array.new
    Array.new(2)
    Array.new(5, "A")

    # only one copy of the object is created
    a = Array.new(2, Hash.new)
    a[0]['cat'] = 'feline'
    a
    a[1]['cat'] = 'Felix'
    a

    # here multiple copies are created
    a = Array.new(2) { Hash.new }
    a[0]['cat'] = 'feline'
    a

    squares = Array.new(5) {|i| i*i}
    squares

    copy = Array.new(squares)
end

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-20 18:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-20 10:08 [BUG] diff -B does not (always?) use colors Matthias Lederhofer
2007-02-20 14:08 ` [PATCH] Teach diff -B about colours Johannes Schindelin
2007-02-20 18:22   ` Junio C Hamano
2007-02-20 18:35     ` Johannes Schindelin

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 NNTP newsgroup(s).