Salvador, you may have provided a UI hook to reduce the diff, but you're not fixing git annotate.

Fixing software often requires version history to tell why a piece of code is what it is, and now the only reason why that code is what it is is... your opinion on whitespace.

That's sad, and people that have done that in the past decade of mozilla code know better now.

Axel

On 16.03.13 08:52, Salvador de la Puente González wrote:
Hello everybody

If you don't know there is an option to ignore white spaces when
comparing commits in GitHub and git, please continue reading:

Yesterday I found a commentary in one of my PR saying a patch involves a
"fairly large merge conflicts on v1.0.1" [1]. If you do something like:

git fetch v1.0.1
git fetch v1-train
git diff v1.0.1  3b4626d5e2c58b9c5647cbd76264ae787cc2a38c --
apps/costcontrol/js/costcontrol.js

You'll see a "fairly large merge". Ok.

This is cause because I'm indenting a block... but this is not Python!
Who cares about indentation*? Now write:

git diff -w v1.0.1  3b4626d5e2c58b9c5647cbd76264ae787cc2a38c --
apps/costcontrol/js/costcontrol.js


You will see the diff as it is really is. The -w parameter ignores
whitespaces. I usually merge with meld [2] enabling the option to ignore
blanks.

You can use this on GitHub as well. For example, see this comparison:

https://github.com/mozilla-b2g/gaia/pull/8169/files


Take note about insertions and deletions.  Big? Really? Now see this
other one:

https://github.com/mozilla-b2g/gaia/pull/8169/files?w=1

You can use w=1 in the querystring of the URL to make GitHub ignore
whites paces.

*Nop, seriously, you should be aware about indentation and other blanks
(sometime is critical [3]) but be reasonable, give a chance to the
"ignore white spaces" option because, sometimes, it is only an
indentation problem ;)

Hope it helps!
Cheers

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=820414#c9
[2] http://meldmerge.org/
[3] http://compsoc.dur.ac.uk/whitespace/

________________________________

Este mensaje se dirige exclusivamente a su destinatario. Puede consultar
nuestra política de envío y recepción de correo electrónico en el enlace
situado más abajo.
This message is intended exclusively for its addressee. We only send and
receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to