13 ms·
Git email flow vs. GitHub flow
- alberth 6y agoSourcehut.org is as close to using “stock” git as you can get. It’s also email based flow. See the following write up this 2018 write up on email vs GitHub flow https://drewdevault.com/2018/07/02/Email-driven-git.html https://drewdevault.com/2018/07/02/Email-driven-git.html
- hashkb 6y agoAnd it's free; and the web interface has no JS, if you're into that sort of thing.
- mehdix 6y agoI assume you mean free software? Since sourcehut is intentionally a paid service for hosting content, albeit free during beta and for contributors.
- hashkb 6y agoSourcehut.org vs the product itself. Nobody is forcing you to use the cloud product. No features are paywalled. The community will support you on their own time on the mailing list. And if you can't afford to pay for the cloud version, you can email Drew and he will help you.
- mehdix 6y agoIt's a while I've switched to sourcehut and learned the email workflow for the first time. It was easier than I thought, and I am very pleased with the outcome. Perhaps leaving megacorp mail clients behind had helped me to embrace this workflow faster.
- twobitshifter 6y agoThis is the first I’ve heard of sourcehut. I agree that it’s a better method. Sticking closer to text and staying away from vendor lock-in is the way to go from my perspective. I’m not anal about my git history, so I can use the GitHub or Gitlqv workflow, without problems, but this would be an improvement.
- alberth 6y agoDrew, who created Sourcehut, is very active on HN https://news.ycombinator.com/user?id=ddevault https://news.ycombinator.com/user?id=ddevault
- properdine 6y agoUnderstand where author is coming from - but doesn't squash-n-merge (newish github feature) solve the issue of needing to rebase and the issue of having too many merge commits? Squash-n-merge has nice property of removing unnecessary local information that probably doesn't matter at a meta level (commits are nice when reviewing PR, doesn't matter much later)
- pabs3 6y agoSquashing commits into one mega-commit isn't great for future investigations of the commit history (code review, bisects etc). It is much better to create separate logical commits, rebase them and pull in the result, either as a branch fast-forward merge, or with a merge commit where appropriate.
- properdine 6y agoa year from now, are you actually going to want to test each individual change in a pull request, or are you going to want to test it as an entire unit? I agree that code review you want smaller units but my experience has been that 1-2 years later, you no longer care about the individual units and instead you want the entire patch/PR all together.
- dboreham 6y agoI think it's more about: in a year from now will you understand the purpose of a change to some code you're debugging? If the commit says "merged PR 2234", answer is probably not.
- pabs3 6y agoI definitely will want to do that, especially when bisecting a random bug that was introduced with one of the changes in that PR. The smaller the unit of change the better, as long as they are logically separate changes.
- pgaddict 6y agoI'm pretty sure you want reasonable meaningful commits. On tiny projects it may not matter, but on larger projects it's definitely a huge benefit, because chances are you'll have to investigate a bug in that code, re-learn why it was done this way, etc. And maybe bisect the git history to find which exact commit caused the issue. Which is why larger changes are often split into smaller patches that may be applied and tested incrementally. If you just merge the whole pull request as one huge patch / in merge commit, you just lost most of that.
- javitury 6y agoReading this article has changed the impression I had about git-mail-flow. Naturally, more questions came to my mind. Is a git-mail-flow compatible with continuous integration? Yes, it seems to be https://sourcehut.org/blog/2020-07-14-setting-up-ci-for-mailing-lists/ https://sourcehut.org/blog/2020-07-14-setting-up-ci-for-mail... Is it possible to construct ergonomic workflows around a git-mail-flow? I suspect you could do it with notmuch and alot, although I wonder which tools do sourcehut users prefer.
- IgorPartola 6y agoThe Linux kernel uses email. I can’t imagine that crowd does things the inconvenient way.
- vxNsr 6y agoInconvenient to who? There a many things in Linux that anyone who doesn’t use Linux full time finds majorly inconvenient, a lot of the UX around Linux is only intuitive to the 45 year old graybeard. To us 30 year old win DevOps guys Linux isn’t actually that “convenient” out of the box.
- edgyquant 6y agoThey were talking about development of the Linux kernel, not using the OS. But I also take issue with your “graybeard” comment. Unix has won out for a reason, I and many other who aren’t old hats prefer the flow of development and deployment on Linux/Unix to that of Windows.
- koonsolo 6y agoEspecially in the frontend world it all seems to be unix command line.
- tasogare 6y ago> Unix has won out Nop, it doesn’t. Linux, which is a Unix clone, has won on some category of computers (notably servers) but most unices derivativing from the original one have a marginal market share. > for a reason Price mostly, and access to sources.
- chii 6y agoI suspect that people who are used to working in small, integrated teams are more used to using the github flow (aka, a web tool to do code reviews which also integrates git commands). People who are more used to a hub and spoke model - aka, a maintainer receiving tonnes of patches from many different people - would prefer the git email flow (it requires less work from them - patches that don't merge is pushed back to the contributor).
- gocartStatue 6y agoFor small, integrated teams, github flow may be suboptimal. Frequent merging to master, aka trunk-based development, aka Continuous Integration is the way to go for me.
- chii 6y ago> trunk-based development, aka Continuous Integration continuous integration isn't trunk-based development (where everyone merges into the same master branch)!
- gocartStatue 6y agoI love pasting that quote :) "The idea that developers should work in small batches off master or trunk rather than on long-lived feature branches *is still one of the most controversial ideas in the Agile canon*, despite the fact *it is the norm in high-performing organizations such as Google.* Indeed, many practitioners express surprise that this practice is in fact implied by continuous integration, but it is: The clue is in the word “integration.” [State of DevOps report 2016]
- ryukafalz 6y agoI like the decentralization aspect, but every time I've had to send patches by email... it definitely has not been as straightforward as the pull-request workflow. I suppose part of that has to do with the project I have experience with using Debbugs (which requires that subsequent patches in a patchset be sent to a newly created address rather than all of them being sent to the same email address). I might like it better if I were contributing to something using lists.sr.ht and could just set the default list address for the project and not worry about it. I do also like being able to update an existing PR as I'm making rapid changes though, and just pushing up to whatever branch my PR references is also really nice. (It's, what, 5 keystrokes to push my latest changes to my remote for that branch? And that's assuming I don't already have the git status buffer open.) Applying a PR is also straightforward, which matters especially for newer users. Uh, you press a button. I'm all for decentralization, but this is the UX you're up against.
- rectang 6y agoYeah, I've got strong git skillz and could handle the email workflow, but I prefer to work with branches rather than a bunch of loose patch files. There are a couple things I strongly dislike about Github though. Number one: the default commit history display with commits force-linearized by date, which is just messed up and wrong when actual Git history can only be properly modeled with a topological view revealing branch lines of development. Give me `git log --graph`!
- pabs3 6y agoThere are lots of graphical history viewers, I use gitk mostly and git-big-picture to get a graphical overview graph without individual commits. The gitg GUI from GNOME is fairly good too, and of course there are better tools for proprietary operating systems.
- rectang 6y agoFor local development, I'm actually content with what I get from the Git command line interface: I use a slightly customized variant of `git log --oneline --graph`. The problem is that I am often browsing the history of repositories hosted on Github via the Github web interface, along with other interactions such as searching through issues and PR history. Cloning a repo to my local machine and firing up gitk is a pretty inconvenient interruption of the web browsing experience.
- maliegrl 6y agoPlatforms like GitHub and GitLab should support a workflow consisting of series of patches instead of a specific commit on a particular branch. They could probably even show pull requests from email in their interface.
- megous 6y agoIt could be as easy as adding some toggle to enable sending a patch series when you push to a specialy named branch, to relevant people (mentioned in the patch message for example, via Cc: tags). Something like: git push master:email/v1 Email/v1 branch would not be created, it would just be a virtual target branch name for this functionality. You can easily make a git hook script to do it with regular ssh/http based git hosting.
- divbzero 6y agoThank you! I’ve heard that Linus Torvalds disliked GitHub pull requests in part because they tried to reinvent the wheel instead of using Git’s native system. I wasn’t clear on what that native system was until reading this article.
- baddate 6y agoHas anyone ever used fossil? https://fossil-scm.org/ https://fossil-scm.org/
- slaymaker1907 6y agoI don't think it is a good idea to allow individuals the ability to force push changes to a branch where said force pushing allows them to impersonate others. If someone with said capabilities ever has their account compromised much less if said individual abuses their powers, you can end up with a scenario where all the provenance guarantees of your repo are gone. For sensitive projects, ideally no code can be merged in unless it is reviewed by somebody else. Even if no malicious code is added, the extra layer of review adds at least some degree of accountability. As for the issues the author mentions, Azure DevOps mostly solves these by having squash commits which can be set to autocomplete once fully approved via reviewers and CI. You can do merging manually in ADO, but most of the time I (the author of the PR) just rebase or merge manually before completing the PR or setting auto complete. There is no VCS that I know of which handles many people modifying the same files simultaneously in a nice way. If you allow for more clever auto merging, you increase the likelihood your merge algorithm produces nonsense. The author should probably be doing this merging since they are the expert on their changes. I think the only real alternative would be if a VCS allowed for a custom merge algorithm (which could do different strategies for different files). A package.json file can't really be merged without some understanding of what a package.json file is or at the very least what a JSON file is.
- halayli 6y agoyou are force pushing to your own branch. It's also frequently done when you rebase your branch.
- ketozhang 6y agoArticle did not mean force push to main branch, they mean force push to working branch when your working branch is behind main and requires a rebase. This is often avoided by doing a merge with main branch instead of a rebase.
- WorldMaker 6y agoYes, most of the issues this article has with PR branches and needing to force push them stems from the self-imposed "requirement" that they don't like merge commits and don't allow them. Obviously that will make working with PRs much harder than the merge-based workflows that PRs were originally built for and still tend to be best optimized for.
- rakoo 6y agoI still don't understand why, for projects and similar topics-based discussion, we don't use NNTP instead of Email. Email is good for addressing specific people only, and you're supposed to have been part of the conversation since the beginning so it does apply to personal correspondence but it scales horribly bad for groups of people: - there is no included history. You need to manually download hand-crafted archives from a bespoke endpoint but then you need to import it all. If you want to quickly read some old message there needs to be a relay to a public inbox type of thing which is a hack - mailing lists software exist but they are another hack. There is no standard for subscribing or unsubscribing - projects often have multiple lists anyway so they need to install them all All of these issues are solved with a network of NNTP servers, and even more: automatic backup of posts because that's how NNTP works, messages are shared accross the network so every message has a specific URI (https://tools.ietf.org/html/rfc5538 https://tools.ietf.org/html/rfc5538) and can be addressed directly and retrieved on-the-fly if needed
- progval 6y agoNot disagreeing with your overall point, but: > - mailing lists software exist but they are another hack. There is no standard for subscribing or unsubscribing There is a standard for unsubscribing: https://tools.ietf.org/html/rfc8058 https://tools.ietf.org/html/rfc8058 And for subscribing, you can often open a mailto: link.
- gkya 6y agoNo "good" NNTP clients, maybe besides Gnus and slrn, which are rather obscure. Gmane was relatively popular, and it was great but went down for a long time, which probably further obscured NNTP. IDK if everyone who used to use it is aware that it's up again, now at http://gmane.io/ http://gmane.io/
- leephillips 6y agoThose are both definitely good clients. And the idea to use NNTP is good, too, but has almost no chance of taking off, for social reasons.
- 6y ago
- 600frogs 6y agoThe author suggests that if I find email horrible to work with, it's my mail client that's at fault, but doesn't expand as to why this is or make any suggestions for what to use - can anyone help me out here? What am I missing from some amazing holy grail mail client that I don't get in gmail webapp or the default MacOS mail app?
- progval 6y agohttps://useplaintext.email/ https://useplaintext.email/ has some recommendations, and is written by the sourcehut devs
- yunohn 6y ago+1 to this. I’ve been searching high and low for a good email client that supports Gmail and Outlook (via OAuth for security). Ideally, it should also work across MacOS and iOS too.
- sreevisakh 6y agoConventional mail clients and web clients are a non-starter if you want to work with mailing lists or git email workflows. To begin with, both of them rely heavily on email threads. Patch sets and reviews are both threaded. Modern clients don't emphasize these threading well enough, and can leave you confused about the context of the messages when using these workflows. Another problem is html mail. Lists and patches are easier to read as plain text. But again, it's hard in modern clients to figure out if you are composing a plain-text or html mail. As a result, you end up with mangled patches and badly formatted text in the mailing list. Another really annoying problem is top-posting when replying to a mail. Ideally, the quotes from original message and the reply should be interleaved, so that the context of the discussion is very clear. But web clients often just quote the entire original message and hide it away at the bottom of the reply. It isn't even easy to expand and split the quotes. Finally, there is the problem of applying patches to repository from email. I don't think this was even a design consideration for modern clients. > What am I missing from some amazing holy grail mail client I assume you are unfamiliar with the workflow. The reality is that the UI is never ideal, even with traditional text mail clients. List support is better than with modern clients, but patches need hacks or a bunch of other tools. But the tool selection makes it way more tolerable than using web-clients or modern desktop clients. There is a lot of room for improvements and there are on-going efforts to improve the situation (like ddevault's aerc). However, you end up with the realization that mailing lists and git email workflow can be as easy and enjoyable as fork-pr workflow, once you overcome the difficulty of initial setup. Perhaps some day, we will have a text client that is trivial to setup and covers all the steps in using mailing lists and patches. For now though, I believe that mutt is the most commonly used client for the workflow. For some other reason, I use mu4e as my client. Drew Devault's aerc looks promising in the long term. For more detailed explanation, have a look at this post by Greg Kroah-Hartman: http://www.kroah.com/log/blog/2019/08/14/patch-workflow-with-mutt-2019/ http://www.kroah.com/log/blog/2019/08/14/patch-workflow-with... (I just discovered this today from ddevault's reply in this discussion).
- maeln 6y ago> If your main complaint is that email is horrible to work with, the issue is most likely not email, it's probably your mail client. This is definitely talking from someone who never had to write software that deal with emails. The reality with emails ? They are an horrible format. There is several RFC describing the "email" format, the usual reference is rfc2822, but technically, you can find other rfc that relate to it (ex, the MIME rfcs: RFC 20452, RFC 20463, RFC 20474, RFC 20485, RFC 2049, RFC 68388, RFC 4289, ...). There is a lot that left to be desired in those RFC in term of specifications. They tend to gloss over some part and also allow several format for retro-compatibility. But then, even the part that are clear and well defined are not respected. I wrote software that dealt with emails for a company that receive several thousands emails on several mailbox everyday. The number of non-complying email that we received that broke our implementation was staggering. Nobody respect the date format, that is standard any more. Then we had some weird stuff, like fields that were mime-encoded even though the spec explicitly say it must not be, attachment metadata that were written completely wrong, headers that made no sense, ... And this was not from your small email provider, it was emails that were coming from a gmail mailbox, outlook, yahoo, ... Oh and MIME is the best footgun in existence. It allows you to do anything and so of course, you receive anything, including mail-in-mail-in-attachement-in-mixed-content-in-multipart. And you better hope that the boundary are not bugged. I wrote HTTP servers, IRC clients, BMP parser, and many more format. Nothing ever came close to the mess that is email. Anything is better than email, that is not the clients fault, it's the format fault. We just keep using it because of network effect. But you can bet that any other communication protocol / format sucks less than email.
- Marazan 6y agoOnce, many years ago, I started writing a library for dealing with IMAP mailboxes. My take way is I have no idea how on earth people have actual working IMAP implementations.
- tonyarkles 6y agoMy first attempt about a decade ago resulted in me sending a patch to Ruby mainline :D
- mugsie 6y agoFor me the happy medium is something like gerrit. It works on the one change, one patch, one commit strategy, which helps with the ability to rebase for fast moving code, makes it easier to view CI results for a patch, and is slightly more user friendly for comments / reviews. It also allows for a group of people to be co-maintainers (e.g. 2 people need to approve a patch before it get merged), and when tied into a CI tool like zuul-ci can help projects be sure the CI tests are testing the actual merged state of the project. The downsides are people need to learn how to rebase, use git commit --ammend, and for the easiest submission install something like git-review or repo to submit patches. (it is possible to use gerrit without them, but remembering the syntax of git push refs/for/<branch> can be difficult.
- brandmeyer 6y agoThe other big downside is that enforcing the unit of review to be a single commit instead of a branch tends to encourage over-large commits. Rebasing a series of related commits for gerrit is a major pain.
- mugsie 6y agoyeah - that is a pain in the beginning. Personally (this is completely anecdotal, and not backed by any serious data), I have found it drives people to do multiple small commits, as they rebase a lot easier. using something like git review means that the entire chain is rebased by default when you summit a new patch on top, and I have the `git commit --am -a --no-edit && git fetch && git rebase` in muscle memory at this point. (the lack of ability to have PRs based off other open PRs is one of the biggest issues I have with the current github / pull request model, so I probably over compensate for that type of situation)
- u801e 6y agoHow does Gerrit handle a group of commits in a branch? That it, if a feature takes several commits to implement and some of them depend on changes made in earlier commits in the branch, how do you ensure that the earlier commit is approved and applied to the main branch before the later commit?
- thcipriani 6y agoI believe what this post is describing is two different integration patterns and not two different workflows: continuous integration[0] vs long-lived branches. Martin Fowler has a good post on the subject: https://martinfowler.com/articles/branching-patterns.html#ComparingFeatureBranchingAndContinuousIntegration https://martinfowler.com/articles/branching-patterns.html#Co... tl;dr: if you make big feature branches and take a lot of time to integrate them it's a painful process. [0]: <https://www.thoughtworks.com/continuous-integration https://www.thoughtworks.com/continuous-integration>
- da39a3ee 6y agoIf a patch is in an email then how do you know which parent commit it should be applied to? A patch is not a thing in its own right in isolation; it should come with a specified parent thus identifying a unique code context in which it is correct. Just because it applies cleanly on a branch does not mean it is correct there.
- sreevisakh 6y agoI have wondered the same too for a long time. But I have never seen the branching commit mentioned. Instead, most of the contributor documentation just ask you to rebase your feature branch on the latest master (or whatever it is called now) and send in those patches. I believe that patchset application is treated the same way as rebasing. It should be possible to apply patches to the master without conflicts as long as the two branches haven't diverged too much. In case the branches did diverge a lot, the contributor is expected to sort it out by the rebase mentioned above. Patch workflow forces you to think about diff introduced by each commit, instead of worrying only about conflicts between two branches when merging. Ultimately, it requires care and discipline from contributor and maintainer that is not strictly necessary with fork-PR workflow. However, commit quality would improve a lot if the same discipline was followed everywhere.
- da39a3ee 6y agoThanks, so yours and the sibling reply by @worldmaker seem more argument against the email workflow. I honestly think it's just smart people being stubborn; men over 50 finding it hard to relinquish what were core tenets of internet-based development in the 90s.
- WorldMaker 6y agoThis is one reason I far more trusted email workflows around darcs than I do with git. In darcs patches were first class objects (including a ton of context information), but in git that sort of information has to travel in manually and in parallel in the email thread.