Sublime Forum

Package Control; add a new package before older package has been merged

#1

I submitted my Find Results Buffer Utils package to Package Control a few weeks ago, my pull request has not yet been merged. No problem the admins are busy.

But now I would like to submit another package to Package Control, called Missing Find Panel Keys. Here’s the problem:

If I add my new package’s details in a new commit on my forked-and-cloned copy of Package Control, then (I am almost certain) it will simply update the pull request of the older package which I’ve already submitted to Package Control. How do I go about adding my new package’s details in a new commit and then creating a new Package Control pull request which is completely independent of the pull request which has already been submitted but has not yet been merged?

While I’m fairly competent at using GitHub, this is beyond my level of expertise. :confused:

0 Likes

#2

I’m on mobile atm so can’t write an in depth reply, but this tidbit might help:

Git Flow :tm: is based on a branch per feature
PRs are for a single branch
if you work on a different branch (ideally another copy of the (original) master branch), your existing PR will be unaffected

1 Like

#3

Just do extend @kingkeith 's answer. You should not create your PR from your master branch, but create a branch with a name related to the PR (this is helpful if you work on multiple branches at the same time).

These are the general steps you can use to create a new PR:

# add the original remote (you only need to d o this once)
git remote add wbond https://github.com/wbond/package_control_channel
# fetch it
git fetch wbond
# checkout the new branch from the original master with the name missing_find_panel_keys
git checkout wbond/master -b missing_find_panel_keys

# do you changes/add/commit
# ...

# push it to your github with the branch name
# if it does not work change it to `git push origin missing_find_panel_keys`
git push

# create the PR on github with the new branch missing_find_panel_keys
2 Likes

#4

Thank you both for your replies.

If I sync my fork with the upstream branch (https://github.com/wbond/package_control_channel) I’m going to have some merge issues, am I not?

Would this work:

From my fork’s current master branch, which is up-to-date with my fork’s origin/master, but way out-of-date with wbond’s upstream master. Note: the only commit I’ve made is the ‘Add FindResultsBufferUtils’ one.

Create the new branch and check-it-out:

git checkout -b missing_find_panel_keys

Make my additions to the repository/m.json file.

Then commit:

git commit -a -m 'Add MissingFindPanelKeys'

Push the branch to my GitHub fork:

git push origin missing_find_panel_keys

Finally create my pull request from that branch?

Or is this going to cause the Package Control merger, or indeed me, problems?

0 Likes

#5

If you do it like this your PR would contain the 2 commits (FindResultsBufferUtils and MissingFindPanelKeys) so it would indeed be problematic.
You can change the checkout line to omit that commit

git checkout HEAD~1 -b missing_find_panel_keys

Using an older branch is not directly problematic, but could potentially cause (little) problems if someone has added a package at the same position.

0 Likes

#6

Of course I now see that my suggested alternative had the major flaw of including both commits. Oops.

I was all set to try your original instructions when - lo and behold - my older package got merged and I no longer had a problem.

Many thanks again for your help r-stein. :slight_smile:

0 Likes