Readit News logoReadit News
r1cka · 4 months ago
I think people worry too much about branch names. Feature branches are usually ephemeral. Prefix your branch with your personal identifier so I know who is primary on it and worry more about the commit message which will live on indefinitely.
morkalork · 4 months ago
Yes, please just name the branch after the ticket/issue number so we can all get the context for it and call it a day
jasonjmcghee · 4 months ago
This. Linear has the one click or shortcut to grab the generated branch name based on the ticket.

With GitHub setup properly, on PR open, it auto comments the link to the ticket and links to the pr in the ticket.

wara23arish · 4 months ago
I hate issue numbers for branch names. ISSUE-9482 doesn’t really provide much.

Ticket link should always be included in PR description.

But branch names should be descriptive like terraform_dev_create_instance

etc

ytreister · 4 months ago
That is what gibr does, it helps you do this with ease
alkonaut · 4 months ago
having feature/username/id-desc is good though. Because at least you can identify why the branch is there. That they are ephemeral doesn't mean that people actually clean them up...
delusional · 4 months ago
Either it has commits I care about or it doesn't. Either way, I'm not going to consult the branch name.

If it has commits I care about, then it stays. If it doesn't, It goes. I'm only deleting on the server afterall, people can just push it back.

ytreister · 4 months ago
Exactly, people tend to leave messes. It makes it much easier to know what the branch was for and have more piece of mind when you want to delete it.
loevborg · 4 months ago
Correct, I use uuids as branch names, to the chagrin of my teammates
brettgriffin · 4 months ago
This would infuriate me. You have to index that guid to something yourself. Why wouldn't you at least give yourself some help (your name, issue number, type of change, area of project, etc). Why make your job harder than it needs to be?
ytreister · 4 months ago
Why would you do this!!!!!
aizk · 4 months ago
Great point
focom · 4 months ago
Commit message should be ephemeral too. Squashing after a PR should be the default. Only at that moment does the PR/Commit message matter.
bavent · 4 months ago
Hard disagree here. GitHub does encourage this sort of thing, but even there for my PRs to be easily reviewable, I like to keep my commits organized and with good messages explaining things. That way the reviewer can walk the commits, and see why each thing was thing was done.

I also like it for myself, when I’m going over my own PRs before asking for a review - I will often amend commits to ensure the work is broken down correctly, each thing that should go together, does.

In a way, stacked PRs are just a higher-level abstraction of this too - same idea, keep work that goes together in the same place.

xorcist · 4 months ago
Did you mean before the PR? Why would anyone have a review system if you change the code after review?

Hopefully the commits are already squashed and rebased before review to value reviewers' time.

dcre · 4 months ago
Sounds similar to a short script I use to generate branch names with jj, which has the advantage that you don’t have to name a branch until after you’ve already written the code, so the LLM can name it based on the contents of the diff.

https://crespo.business/posts/overeng-pr-create-jj/

teiferer · 4 months ago
I was so afraid that this is another "look I built sth that uses AI!" post, slopped together in an afternoon. I'm glad it's not, such a relief!

This reaction tells me a lot about the state of our industry. (Or just the state of my mind.)

ytreister · 4 months ago
I used some AI to help me, but I put in a lot of thought to how it is created. I have plans to add many more useful features over time.
celticninja · 4 months ago
I think branch names are quite unimportant in development and often don't worry about them being too descriptive.

In my org it is common to use the JIRA ticket number in there somewhere but other than that I think you should leave it up to devs. I can't think of a reason why I would need to know the branch name.

My favorite branch name I created was for a JIRA ticket with the number 2468.

This became ab-2468-who-do-we-appreciate

Detailed branch naming conventions are just another piece of useless documentation for devs. And if you are using the branch name to tell you what is going on the you are misunderstanding the review process.

ytreister · 4 months ago
When you use Gitlab and squash your merge request, a new merge commit with the name of the branch is created, so I found it very helpful in that situation to know the name of the branch.
ytreister · 4 months ago
Hey everyone — I’m actually the author of gibr!

I just wanted to say thanks for all the comments and discussion. It’s been amazing (and honestly a bit surprising) to see so many developers checking it out.

The idea for gibr came from the frustration I had when I was forced to use Jira for issue tracking and GitLab for our repos. At the time, I built an internal tool called jig that integrated the two. With a single command, it could create a branch, push it, transition the Jira issue to In Progress, and open a merge request with everything pre-filled — assignee, reviewers, description, and so on. It became really popular at my company.

I decided to take that idea further and rebuild it as an open-source tool with a plugin architecture, so it could work with any issue tracker or Git provider, not just Jira and GitLab.

If anyone has feedback or ideas for new integrations, I’d love to hear them — some great suggestions have already come in that might make it into the next release.

Thanks again for the support — this community is awesome.

spencera · 4 months ago
I think in 2025 "intelligently creating" kind of implies the use of AI but (thankfully) this is just doing a string format based on an issue title.
ytreister · 4 months ago
I don't know why I did not think of that, but I can see how people would assume this nowadays!
roflchoppa · 4 months ago
a format that as worked well for me (and that I've brought with me to other teams)

``` issues/{username}/{issue-number}-{description} ```

The username prefix is helpful, for both organization, and locating branches.

ytreister · 4 months ago
Unfortunately, gibr does not yet support username in the branch name, but I created an issue and hopefully can get it done very soon

https://github.com/ytreister/gibr/issues/42

ytreister · 4 months ago
I implemented this in version 0.6.0 which was just released. https://github.com/ytreister/gibr/releases/tag/0.6.0 The issue assignee can be used in the branch name.

In the future I want to allow a user to easily assign an issue to the current user if they use gibr with an unassigned issue

paradox460 · 4 months ago
I rarely make named branches these days. Just use JJ git push -c, which creates a branch name based off the change I'm pushing
ytreister · 4 months ago
Interesting. That seems to work if your work is not associated with an issue tracker. Many use issue trackers and like to link each branch or PR/MR to an issue tracker.
paradox460 · 4 months ago
We've done the same thing, but we only link JIRA tickets to PRs, so when I open a PR, I stick it in the PR description body.