News for hackers. Stuff that matters.
Re:My unorthodox, branchless Git workflow by nicksantamaria on Monday April 06, 2020 @09:56PM (#22799710)

    No time spent creating new branches for new features.
    No time spent switching between branches to address feedback.
I'm sorry but these are non-issues with git. The approach you've outlined makes collaboration on features impossible. Cherry-picking and rebasing does not scale for either teams, or lots of parallel workstreams.
Re:My unorthodox, branchless Git workflow by Tomte on Tuesday April 07, 2020 @10:02AM (#22803264)
Yes, that's very unconvincing.

He may think that he is rebasing later anyway, but sorting all those commits into "need for my feature" vs. "don't need for my feature", followed by the rebasing within the feature certainly takes much longer than the split second of creating a branch and keeping those features separate from the beginning.

It's great if it works for him, but he's certainly not saving time.

Re:My unorthodox, branchless Git workflow by dionian on Tuesday April 07, 2020 @10:21AM (#22803434)
Yeah, maybe if the project is super small and you can memorize everything about it. but this doesn't scale to many real-world size projects very well
Re:My unorthodox, branchless Git workflow by drchopchop on Tuesday April 07, 2020 @10:24AM (#22803461)
git checkout -b new_feature_branch is an onerous workflow?
Re:My unorthodox, branchless Git workflow by Cthulhu_ on Tuesday April 07, 2020 @10:52AM (#22803734)
Switching branches does get a bit annoying if you happen to work in multiple branches simultaneously and have to switch halfway through a task, or there's a lot of differences; however, that is also a matter of organization.

It's happened to me though; one scenario is that you created a couple of merge requests for the same repo over the course of a day, and the next day feedback from code review or testing comes in. You end up having to switch to various branches to fix the reviews.

But that's really not that big of a deal. The context switch is worse than the git checkout call.

Re:My unorthodox, branchless Git workflow by the8472 on Tuesday April 07, 2020 @11:04AM (#22803842)
git worktree[0] can help with working on multiple branches at once, especially if your workflow involves having a bunch of uncomitted changes. You could also stash them, but if there are more complex things like submodules, ignored build artifacts and so on you don't want to mess with then worktrees are a good alternative.

[0] https://git-scm.com/docs/git-worktree

Re:My unorthodox, branchless Git workflow by dkersten on Tuesday April 07, 2020 @11:14AM (#22803947)
> Switching branches does get a bit annoying if you happen to work in multiple branches simultaneously and have to switch halfway through a task, or there's a lot of differences

Sure, but its not like the different changes just don’t exist if you use only master, branches are a way of managing them separately and only merging when you are ready, if you don’t use branches, you have to have some other way to manage this. If you don’t, and its not a problem, then you could also just not work on three branches at once.

Re:My unorthodox, branchless Git workflow by malingo on Tuesday April 07, 2020 @11:08AM (#22803900)
Git checkout understands "hyphen expansion" for your previous branch (a la `cd -` to switch to your previous working directory), so switching between two branches is as easy as `git checkout -` or even `git co -` if you have an alias.
Re:My unorthodox, branchless Git workflow by iainmerrick on Tuesday April 07, 2020 @11:17AM (#22803985)
But you’ll also have to rebuild. If your build system is bad, that could be slow. If your build system is really bad, you might need a clean build.

All build systems (that people actually use) are really bad.

Re:My unorthodox, branchless Git workflow by alunchbox on Tuesday April 07, 2020 @10:50AM (#22803698)
Is it? Simple solution setup a an alias _git cob new_feature_ which can fill in the rest. Takes a second or two to write.
Re:My unorthodox, branchless Git workflow by mrunkel on Tuesday April 07, 2020 @11:16AM (#22803970)
gco -b new_feature_branch for me.