Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch custom actions for Gerrit #301

Closed
cnovel opened this issue Jun 3, 2019 · 7 comments

Comments

@cnovel
Copy link

commented Jun 3, 2019

This is a very specific workflow when using Gerrit Code Review. The commit can't be pushed directly to the origin branch (let's say origin/master) but to a staging branch (origin/refs/for/master) where the commit is validated through the interface and then merged in origin master.

Now in my git config for my repo I have the following:

[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[submodule]
	active = .
[remote "origin"]
	url = ssh://cnovel@xx.xxx.xx.xx:29418/myrepo
	fetch = +refs/heads/*:refs/remotes/origin/*
	push = refs/heads/*:refs/for/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

But Fork doesn't seem to be taken this modification into account. When pushing the only option available is origin/master

image

Now I'm no git expert so I'm not sure the origin branch should be origin/refs/for/master. I can provide you some logs from SourceTree (I'm trying to switch) if that's helping you.

@DanPristupov

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2019

I think you can create a custom action for that.

You can find some info there: ForkIssues/Tracker#123

@cnovel

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

Is it possible to add a variable $branch in Commit Custom Action? That way my action can be $git push origin HEAD:refs/for/$branch, instead of creating a custom action per branch.

@DanPristupov

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

We probably need a new type of custom action - Reference custom action, which could be applied to local and (or) remote branches and (or) tags.

Then this action will appear in every branch context menu (either on sidebar on in the commit list).

What do you think?

@cnovel

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

Not sure about the terminology (maybe Branch custom action can do the trick) but yes what I'm trying to do is pushing a branch, not just a commit. Having the action appearing in the side bar or commit list is good.

@DanPristupov

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

Not sure about the terminology (maybe Branch custom action can do the trick)

Yes, I agree. Branch custom action should be clearer.

(In git both branches and tags are references)

OK, I'm adding this to my todo list. I will report ETA later.

@DanPristupov DanPristupov changed the title Push to refs/for according to the .git/config Branch custom actions Jun 6, 2019

@DanPristupov DanPristupov changed the title Branch custom actions Branch custom actions for Gerrit Jun 6, 2019

@DanPristupov DanPristupov added this to the 1.34 milestone Jun 7, 2019

@DanPristupov

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

I just released 1.34 with the support of branch custom actions. I'm looking forward to hear your feedback.

@cnovel

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

Hi Dan, sorry for the delay. I've just tested it and it's perfectly working. UI is great too. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.