Flix01 / imgui

Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
MIT License
396 stars 34 forks source link

Rename branch? #48

Closed ocornut closed 5 years ago

ocornut commented 5 years ago

Hello @Flix01,

I was thinking today, it may be misleading to people to see the branch called "2015-10-Addons", they may think the repository is very old while in reality it is fairly active and useful.

I would suggest to rename it, e.g. imgui-with-addons or something in this vein :)

Flix01 commented 5 years ago

Yes, that makes sense...

...the only problem is that I'm still not very familiar with the git command-line and I'm always afraid of breaking something (it always happens when I try new things with git :thinking: ).

I'll think about it... Ideally there should be a way of renaming the branch that is seamless for people pulling from it (well, I'm not sure about this).

In short, it's more a technical problem from my side :blush:.

ocornut commented 5 years ago

If you google it you'll find the solution (I think it just involve pushing the current branch with a new name, then deleting the old one).

It won't be seamless for people pulling from it - but it'll be trivial for people to understand that the branch was removed/renamed, you may clarify in the readme. And it's also probable that many users just copied a few files (for the widgets they use) and haven't pulled everything?

I think it is worth it but it's a suggestion, up you :)

Flix01 commented 5 years ago

It won't be seamless for people pulling from it.

Actually I think there are two names that I can change:

  1. the proper branch name (currently "2015-10-Addons").
  2. the "Repository name" (currently "imgui"), that I can easily change directly from the "Settings" tab in my browser.

I'm not sure, but I think that the latter is the name of the fork URL (https://github.com/Flix01/imgui). If this assumption is true, probably people can keep pulling from it without being affected by the branch name change (even if it's not clear if they can merge two branches with different names).

[Edit] Currently the "Default Branch" of my fork (in the "Settings/Branches" tab) is "2015-10-Addons". The docs say: "The default branch is considered the “base” branch in your repository, against which all pull requests and code commits are automatically made, unless you specify a different branch." That's why I asked about the possibility of seamless pull commands from the users if I change the branch name. [/Edit]

I assume your suggestion is to change the name at point 1.

I think it is worth it but it's a suggestion, up you :)

I appreciate and agree. I'm going to try it in the next days, hopefully. Thanks for your tips.

Flix01 commented 5 years ago

@ocornut: I think I've done it! Hope it works. I still don't know the changes required from existing pullers/forkers.

For future reference, here is what I've done:

# optional initial check
> git remote -v
origin  https://github.com/Flix01/imgui (fetch)
origin  https://github.com/Flix01/imgui (push)
upstream    https://github.com/ocornut/imgui (fetch)
upstream    https://github.com/ocornut/imgui (push)

# local folder: current branch check
> git branch
* 2015-10-Addons

# This is a branch_rename of the current branch:
> git branch -m imgui_with_addons

# check:
> git branch
* imgui_with_addons

# This pushes to remote (origin) the new branch (so there are both '2015-10-Addons' and 'imgui_with_addons')
> git push origin imgui_with_addons
Total 0 (delta 0), reused 0 (delta 0)
remote: 
remote: Create a pull request for 'imgui_with_addons' on GitHub by visiting:
remote:      https://github.com/Flix01/imgui/pull/new/imgui_with_addons
remote: 
To https://github.com/Flix01/imgui
 * [new branch]        imgui_with_addons -> imgui_with_addons

# At this point with my browser in "Settings/Branches"
# I switched the default branch from '2015-10-Addons' to 'imgui_with_addons'

# This deletes the branch '2015-10-Addons' from remote (origin)
> git push --delete origin 2015-10-Addons
 - [deleted]           2015-10-Addons

# optional final check matches the initial check
> git remote -v
origin  https://github.com/Flix01/imgui (fetch)
origin  https://github.com/Flix01/imgui (push)
upstream    https://github.com/ocornut/imgui (fetch)
upstream    https://github.com/ocornut/imgui (push)

# Hope everything works now...

# Hey! Not so easy!
# ...well actually I had to add a couple of other commands...
> git status
On branch imgui_with_addons
Your branch is based on 'origin/2015-10-Addons', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)
nothing to commit, working tree clean

> git branch --unset-upstream
(no output)

# Then after having modified and added (git add) some files:
> git push
fatal: The current branch imgui_with_addons has no upstream branch.
To push the current branch and set the remote as upstream, use
    git push --set-upstream origin imgui_with_addons

> git push --set-upstream origin imgui_with_addons
Branch 'imgui_with_addons' set up to track remote branch 'imgui_with_addons' from 'origin'.

@ everybody: if something stops working, please post here about it. Otherwise I'll close this within one/two weeks.