martedì 6 marzo 2012

git merge & commit message

E' stata apportata una modifica importante a git, il famoso DVCS sviluppato per il kernel di Linux e oggi utilizzato in moltissimi altri progetti. La modifica riguarda il merge di due o piu' rami: attualmente git effettua il merge in modo "silenzioso", inserendo un messaggio automatico che indica un generico "merge of ". Con la modifica apportata git chiedera' all'utente di inserire un messaggio personalizzato. Banale, ma molto efficace: anzitutto consente all'utente di motivare il merge, e in secondo luogo consente all'utente di riflettere fino all'ultimo sull'esigenza del merge e nel caso di annullarlo.
Lo stesso Linus Torvalds commenta così la nuova feature:
This change hopefully makes people write merge messages to explain their merges, and maybe even decide not to merge at all when it's not necessary.

I've been using that git feature for the last few weeks now, and it has resulted in my merges from submaintainers having various notes in them (well, at least if the submainter gave me any). So I'm trying to lead by example.

But if you don't like explaining your merges, this might be annoying. Of course, if you don't explain your merges, you are annoying, so it all evens out in the end. "Karmic balance", so to say.

Nessun commento: