Most active commenters
  • ytreister(5)

←back to thread

35 points Terretta | 18 comments | | HN request time: 0.001s | source | bottom
Show context
r1cka ◴[] No.45772653[source]
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.
replies(5): >>45772677 #>>45773377 #>>45773466 #>>45774133 #>>45774578 #
1. morkalork ◴[] No.45772677[source]
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
replies(3): >>45772963 #>>45773320 #>>45784312 #
2. wara23arish ◴[] No.45772963[source]
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

replies(3): >>45773128 #>>45773171 #>>45784316 #
3. 6LLvveMx2koXfwn ◴[] No.45773128[source]
we do:

  [feature/bug]/ISSUE-NUMBER-summary-of-issue
e.g.:

  bug/psi-456-broken-args-parsing
replies(2): >>45773179 #>>45784322 #
4. jjgreen ◴[] No.45773171[source]
I've worked in a couple of places with <issue ID>-<something descriptive> conventions, moderately useful
replies(2): >>45773317 #>>45775386 #
5. darkwater ◴[] No.45773179{3}[source]
More or less the same here, but we (I?) prefix it with the username as well, so when pulling branches you know who created it.
replies(3): >>45773812 #>>45774594 #>>45784353 #
6. krferriter ◴[] No.45773317{3}[source]
Yes, `issue-10-add-feature-X` style is best.
replies(1): >>45774811 #
7. jasonjmcghee ◴[] No.45773320[source]
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.

replies(1): >>45774582 #
8. celticninja ◴[] No.45773812{4}[source]
But the PR and git blame can tell you this so I would never look at the Branch name to find out this information
replies(1): >>45775078 #
9. dewey ◴[] No.45774582[source]
This is probably my favorite Linear feature.

1) Cmd + shift + . -> Copy branch name

2) Build feature on that branch name

3) Build / Merge on Github and Linear closes the issue

10. dewey ◴[] No.45774594{4}[source]
A nice benefit of prefixing by your-name/issue-1234-some-description is that many git clients will show it in a folder structure that way and it's easy to differentiate yours from other branches.
11. bavent ◴[] No.45774811{4}[source]
I have a little script that does this automatically - lists out Jira tickets assigned to me, then when I select one, creates a branch with the ticket number and the title, subbing hyphens for spaces and truncating if needed. It’s handy for when I want to list branches, I can filter on keywords I remember from the ticket name.
12. darkwater ◴[] No.45775078{5}[source]
For me is useful when I run 'git fetch' from the command line. I don't use any graphical git client
13. johntash ◴[] No.45775386{3}[source]
That's been my preference at most places I've worked. issue id so the branch gets linked to jira or whatever and a short description to find the branch later if needed.
14. ytreister ◴[] No.45784312[source]
That is what gibr does, it helps you do this with ease
15. ytreister ◴[] No.45784316[source]
gibr makes it easy to do this and in a consistent manner
16. ytreister ◴[] No.45784322{3}[source]
gibr makes it super easy to do exactly this!
17. ytreister ◴[] No.45784353{4}[source]
I added a new TODO issue so that username can be configured in the branch name. gibr currently does not have support for username.

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

replies(1): >>45796744 #
18. ytreister ◴[] No.45796744{5}[source]
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.