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

Add topic-pull-merge #56

Merged
merged 3 commits into from
Oct 10, 2019
Merged

Conversation

marsop
Copy link
Contributor

@marsop marsop commented Oct 3, 2019

I am currently using topics, and synchronizing with the topic-base-branch-name using rebase is not useful when the topic has already been published to the remote. In this scenario, topic-pull-merge is a better way to synchronize than topic-pull-rebase and can help to solve local merge conflicts.

@joelparkerhenderson
Copy link
Member

joelparkerhenderson commented Oct 4, 2019

I see what you mean. What you're asking is different than the intent (see below) thus there's a chunk of stuff to do.

What you're doing (if I understand you correctly) is using a topic branch, and you want to bring in changes from the base branch. In my experience, this would be a typical one-way workflow e.g. a developer wants to download new code, from the remote base branch, to the local topic branch.

What the existing topic pull/push/sync aliases intend to do is get/put changes of the topic branch located elsewhere e.g. a remote tracking branch. The intent is to favor two-way sync, such as when multiple developers are working on the same topic branch and working as a distributed team. The existing aliases do not intend to bring in changes from the base branch e.g. because these changes would be integrated by a continuous integration server or process or practice.

This makes me think that there's a need for a better way to name the existing aliases, and also then add the intent of yours.

What do you think of this?

@marsop
Copy link
Contributor Author

marsop commented Oct 4, 2019

This makes a lot of sense, when I think about topic-branches as a collaborative effort and not a single feature-branch developed by a single person. I guess I got confused when I saw the existing topic-pull-rebase, since as I understand it, this also goes against a shared branch that will be integrated by CI server.

In any case, when the implementation in the topic-branch is finished, the topic-branch hast to be polished so that this CI tool can integrate it in the base-branch. In order to do this, there is at the moment no other way than pulling the base-branch into the topic-branch (note that this is only necessary in case of merge-conflict, otherwise this should be a normal forward merge).

Please feel free to reject my PR if it does not meet the expected workflow for topic-branches.

@joelparkerhenderson
Copy link
Member

You're right, the topic-pull-rebase alias is in the same category. This makes me confident that you're on the right path. And I know firsthand from many teams that your kind of workflow is very common and very useful, thus I would like gitalias to support it.

What would you name the aliases, that could help users understand the two kinds of workflows a.k.a. the two different purposes a.k.a. remote topic flow to local topic vs. remote master flow to local topic?

@marsop
Copy link
Contributor Author

marsop commented Oct 8, 2019

uhm.. maybe something like topic-merge-base and topic-rebase-base ?

reducing the operation to its simplest expression what you want to do is "update your topic with information from base". Since all the operations related to topics have the topic- prefix, I think that either topic-sync-base-merge or topic-merge-base are adequate. However, the former is rather long for an alias, thus I would recommend the second.

@joelparkerhenderson
Copy link
Member

Good idea. Let's do your second idea. Do you want to update the PR, so you get the credit it? Or if you prefer, I can add it as you describe. Thanks for your help!

@marsop
Copy link
Contributor Author

marsop commented Oct 10, 2019

Sure, I will update the PR and add some comments to both aliases so that the intent is clear. Thanks for the guidance.

@marsop
Copy link
Contributor Author

marsop commented Oct 10, 2019

Ready :)

@joelparkerhenderson joelparkerhenderson merged commit 56b0c13 into GitAlias:master Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants