2012-11-19 1 views
2

J'ai deux patches sur gerrit et je voudrais faire le non fusionné sur le patch fusionné.Comment créer des dépendances entre un correctif fusionné et un correctif fusionné dans gerrit?

Les deux sont téléchargés sur gerrit pour le moment.

  • Comment puis-je le faire? Est-ce possible?

  • puis-je le faire via gerrit? pas par le git et le choix de cerise.

Disons que https://gerrit.wikimedia.org/r/#/c/34106/ est le fichier unmerged

Le fichier fusionné https://gerrit.wikimedia.org/r/#/c/25756/

Répondre

3

dépendances dans Gerrit ne sont qu'une représentation du graphe d'arbre Git. Donc, pour que le changement B dépende du changement A, B doit avoir A comme parent.

Dans votre cas, vous avez deux modifications dans deux référentiels différents. Les dépendances inter-référentiel ne sont actuellement pas supportées dans Gerrit. C'est un commonly-requested feature cependant, et a été discuté lors de la conférence d'utilisateurs Gerrit le week-end dernier. Espérons que la prise en charge des dépendances entre référentiels sera ajoutée dans une future version de Gerrit.

+0

pourriez-vous s'il vous plaît me dire exactement ce qu'il faut faire? merci – 0x90

+0

Désolé - comme je l'ai dit ci-dessus, ce que vous voulez faire n'est pas actuellement possible dans Gerrit. C'est quelque chose sur lequel les développeurs réfléchissent et travaillent. Beaucoup d'utilisateurs veulent le faire mais ne peuvent pas actuellement. – Brad

+0

Je voulais dire en git ... donc si quelqu'un cherche cette question, il verra une solution. – 0x90

2

Utilisation des commandes git prises de here:

git fetch --all # Make sure we have latest info from the repository 
git review -d 1234 # Gerrit change number of the change you want as dependency ("parent") 

git checkout -b bug/1234 # Creates a new branch, with the current branch (the dependency) as parent 
# Edit files: make your changes 
git add someFile.php some/other/file.js 
git commit # Commit your patch 

git log -n5 --decorate --pretty=oneline # Verify that the last 5 entries of the log now start with: 
# * (HEAD, bug/1234) your change 
# * (review/john/700) the dependency 
# * (gerrit/master) 

git push gerrit HEAD:refs/for/master # Use this instead of `git review` 

git branch # Take note of the review/* branch that was created for this, it has an "*" in front of it 
git checkout bug/1234 # Check out the local topic branch of your change 
git rebase review/john/7000 # The branch name of the gerrit change we checked out earlier 

# Resolve conflicts if needed, 
# - use "git status" to see the files that need resolution 
# - after fixing it in your editor, "git add filename" for each of the fixed files 

git commit --amend -c HEAD # Re-commit your patch replacing the one with the wrong parent 

git log -n5 --decorate --pretty=oneline # Verify that the last 5 entries of the log now start with: 
# * (HEAD, bug/1234) your change 
# * (review/john/700) the dependency 
# * (gerrit/master) 

git push gerrit HEAD:refs/for/master # Use this instead of `git review` 
Questions connexes