Skip to content

Comment on What was the strangest coding standard rule that you were forced to follow?parent

Comments

"It's sometimes astonishing how the pursuit of optimal diffs masks the intent of a change where an added method diff starts with the closing brace of the previous method, for example."

In Python you can get the whole return statement. Especially when adding a similar type of method, e.g.: Django view functions. Makes

    git add -p
more fun.

I've found that experimenting with the various git diff algorithms helps out. IIRC there is an "-x patience" flag you can pass to git-diff and tools which use that, which spends more time to get "better" diffs.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.