2013-04-20 13 views
11

Sono nuovo in Gerrit e desidero creare una nuova patch quando vengono inviate nuove modifiche. ha installato Gerrit con questa guida https://review.typo3.org/Documentation/install-quick.htmlCome creare un nuovo Patchset in Gerrit?

Poi cerco di creare una nuova patch con http://gerrit.googlecode.com/svn/documentation/2.0/user-changeid.html ed anche ha aggiunto linea di Change-Id in fondo al messaggio Commit-.

Ma sto ottenendo un nuovo Cambiamento invece di un nuovo Patchset .. Qualcuno può aiutarmi ..?

Grazie

+0

cambiano-ID partita ? – kan

risposta

22

Fase 1: Installare i ganci commit-msg per Gerrit

scp -p -P 29418 localhost:hooks/commit-msg .git/hooks/ 

Fase 2: Creare normale commit e spinta (per Patchset1)

per esempio:

git add Server.java 
git commit -m "server added" 
git push origin HEAD:refs/for/master 

Fase 3: Dopo aver fatto alcune modifiche per Server.java

al fine di creare nuove Patchset (Patchset 2)

git add Server.java 
git commit --amend 
git push origin HEAD:refs/for/master 

Ripetere passaggio 3 per ulteriori patch

+2

Una nota per chiunque sia potenzialmente confuso - questo significa letteralmente che dovresti premere su 'refs/for/master'. Questo non è un segnaposto per il nome di un ramo remoto che devi calcolare - in realtà è il nome del ramo remoto che gerrit si aspetta – Hamy

+1

Non dovresti installare l'hook 'commit-msg' * prima *? Con questi passaggi, il commit iniziale inviato a gerrit non avrà un id di modifica. – larsks

+0

Grazie a @larsks, ha aggiornato la risposta ora. – Gangaraju

3

Non aggiungere il Change-Id da soli. Installa il gancio di commit-msg come descritto here. Questo creerà automaticamente l'ID per te.

Se si vuole migliorare una patch caricando una nuova patch-set, utilizzare git-commit --amend e mantenere il Change-Id linea così com'è.

è possibile vedere una descrizione del flusso di lavoro qui: http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine

0

Anche se si aggiunge Change id manualmente dovrebbe essere ultimo paragrafo del messaggio di commit.
E la sintassi dovrebbe essere:

change ID : [change ID ] 
Problemi correlati