9 ms·
Show HN: Learn to use email with Git
- OJFord 8y agoNo JS - I was baffled - did not know about `<label for="<target here>">`. Nice. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label https://developer.mozilla.org/en-US/docs/Web/HTML/Element/la...
- stronglikedan 8y agoIMHO, the single-most underused HTML attribute. I get annoyed when I have to aim for the tiny box, instead of the nice long string of text next to it. Although, I can't count the number of times I was guilty of omitting it many moons ago.
- jancsika 8y agoIsn't it better to nest the checkbox inside the label? Then you don't need the for attribute nor an id.
- thristian 8y agoThat works nicely for checkboxes, but sometimes you want the form field and label to be in (say) different cells of a table row or something.
- jalbertbowden 8y agolabels should always be to the right of the checkbox/radio controls. never nest them. nesting is ok for other form controls in some instances, but you'll run into issues with various screen readers if you apply the for attribute while nesting. on that note, always nest when possible; the ux benefits make it crazy not to take advantage of it.
- forgotmypw 8y agoIs there a reason to not nest the checkbox inside the label? I have always put them next to the checkbox until very recently, when I was trying to increase clickable area. I've found it ends up working much better than putting it beside, covering the area around the checkbox, too! Is this "improper HTML"?
- forgotmypw 8y agoYou still have to do the complementary for= and id=, but I am also a proponent of nesting, though I have not solicited public opinion on it until just now. Here is how I started doing it: <label for=abc><input type=checkbox id=abc ...> display alphabet<label>
- stephenr 8y agoWhat do you mean by “have to”? The whole point of nesting is that the association is implicit.
- forgotmypw 8y agoI'm not sure how "proper" this is, but you can also put the checkbox inside the label, turning the whole thing into one big clickable area. <label style="padding:5pt"><input type=checkbox> this is label</label>
- rhn_mk1 8y agoIt seems to have a cost though, how do I link to a specific page? Anti-snark edit: what's the URL to a specific step?
- zepolen 8y ago<a href>
- deleted 8y ago[deleted]
- darkstar999 8y agoYou can't.
- Svip 8y agoCould have used `:target` instead then.
- Sir_Cmpwn 8y agoJust merged this patch which makes each page linkable :) https://lists.sr.ht/~sircmpwn/public-inbox/%3C20190404212127.23884-1-lukas%40lwrl.de%3E https://lists.sr.ht/~sircmpwn/public-inbox/%3C20190404212127...
- jalbertbowden 8y ago? https://git-send-email.io/#step-2 https://git-send-email.io/#step-2
- darkstar999 8y agoWell, it takes some form & css trickery as well. I'd call this more hacky than anything. It doesn't let you link to a specific step. https://git-send-email.io/index.css https://git-send-email.io/index.css
- gbear605 8y agoIt does now, after a small patch: https://git-send-email.io/#step-2 https://git-send-email.io/#step-2
- deleted 8y ago[deleted]
- sevensor 8y agoOne thing a lot of email providers (at least gmail and fastmail) do is let you create application passwords that you can use for specific purposes. So if you're at all queasy about having your password in plain text on the hard drive, you can create a special password just for git. Edit: you don't have to set up a terminal email client at this point, but if you figure out how to use git-send-email, you're just inches away from using mutt.
- Sir_Cmpwn 8y agoYou can also omit it and type it in each time you use git send-email, or you can set it up with your on-site keyring using git-credential: https://git-scm.com/docs/gitcredentials https://git-scm.com/docs/gitcredentials
- sevensor 8y agoAh, that's quite nice. I like the ability to strike your own balance between convenience and paranoia afforded by git-credential-cache.
- bo1024 8y agoThey're getting closer to public-key authentication, I guess that's good.
- yellowapple 8y agoOoooooo. Is there such a thing as SSMTP/SIMAP (i.e. something that is to SMTP/IMAP as SFTP is to FTP - i.e. an SSH-based thing that sends and/or receives mail to/from a mail server)? It'd be badass to be able to literally just use my SSH keys to authenticate when sending/receiving mail.
- bo1024 8y agoThat does sound perfect. Don't know if it exists.
- 8y ago
- bo1024 8y agoCan only speak for myself, but I didn't understand enough context to get much out of the site. I'm used git for small, personal collaborations, so I don't know why it sends email or when you would want it to do that. I don't know what a "patch" means here and why you use email with them. If I'm not your target audience, then that's fine, but it might be helpful to have some background on this. Otherwise, the site and layout look great to me. It is a little tricky to have step 1 be installation, because someone who just wants to find out more without installing might stop there (I was a little deterred, then I just picked a random OS and clicked through the instructions).
- Sir_Cmpwn 8y ago>I'm used git for small, personal collaborations This is a great reason to use email! You don't need a platform at all, you can use the tools presented in this tutorial to email your work directly to your collaborators. Outside of that, email is used for collaboration with many large and important projects, such as Linux, PostgreSQL, and git itself. I have some writings about why I think this workflow is nice: https://drewdevault.com/2018/07/23/Git-is-already-distributed.html https://drewdevault.com/2018/07/23/Git-is-already-distribute... https://drewdevault.com/2018/07/02/Email-driven-git.html https://drewdevault.com/2018/07/02/Email-driven-git.html (forgive the formatting on the latter, fix is being deployed now)
- bo1024 8y agoThanks for the reply. I'll explain why I'm still confused/unsure what is going on, hope it is useful feedback. My understanding of git is that there is a server, and users push/pull to the server. So from an initial look at everything you provided, it sounded to me like git-send-email gives people email notifications to know what has been changed on the server, for example. I don't know what "email-driven workflow" means and that was my best guess. But from someone else's reply, it sounds like you are discussing an alternative to the server model, where there is no server at all and pushes and pulls are communicated completely via email. This seems consistent with your 2018-07-02 post, but honestly I didn't really get it from there the first time. Is it correct?
- rhn_mk1 8y agoThe page sets a background color, but not text color. With system theme, I get white text on white background.
- yellowapple 8y agoLooks like it'd be enough to add a "color: black;" right after the "background: white;" on line 13. I'm sure the page author would appreciate you emailing them a patch :)
- kbeckmann 8y agoGreat guide but there seems to be a typo/mistake regarding how to save the smtp password in step 2/gmail: should use sendemail.smtpPass instead of the non existing sendemail.password.
- Sir_Cmpwn 8y agoGood catch! Want a chance to try out your email skills and send a fix to ~sircmpwn/public-inbox@lists.sr.ht? The git repo is here: https://git.sr.ht/~sircmpwn/git-send-email.io https://git.sr.ht/~sircmpwn/git-send-email.io. If you're not interested, I'll push the fix, but figured I'd give you a chance to get credit for it.
- kbeckmann 8y agoIn the e-mail reply that you get when following the guide you get something to copy paste that looks like this: git send-email -v2 ... I tried to find documentation regarding the -v[0-9]+ parameter but couldn't find it at all. What am I missing in the docs? Seems a lot of guides recommend people to use this feature, however there is not a word regarding it in the git docs. It seems that it takes a positive integer as a parameter and adds it to the [PATCH v1] prefix in the subject.
- Sir_Cmpwn 8y agoThis is a parameter that gets passed to git format-patch. Any parameters git send-email doesn't directly recognize are passed along to format-patch.
- kbeckmann 8y agoAha! Makes sense. The docs are usually great for git, but it wasn't clear to me that the args were passed on to git format-patch, where the -v parameter indeed is properly documented.
- WorldMaker 8y agoSomething this reminded me of: in the tutorial it is mentioned to check the project README for possible emails to send patches to, but darcs had a nice config option (pref) [1] to suggest a repository's default TO email address when `darcs send` sending an email patch. It's a small papercut in the `git send-email` workflow, but providing an automated way for a git repo to suggest its patch email list would simplify the workflow and maybe encourage more users to try it. [1] http://darcs.net/Using/Configuration#email http://darcs.net/Using/Configuration#email
- Sir_Cmpwn 8y agoThis is actually something I plan on adding to git sooner or later.
- johntash 8y agoMaybe I missed it, but I think it would be great to also explain what happens on the other end of this process. What does someone do when they receive a patch?
- drexlspivey 8y agogit apply filename.patch
- u801e 8y agoIt's a little more involved than that depending on what mail client you use. There is no git-get-email command that would standardize the experience.
- chmln 8y agoThis is great for small one-off projects, but I don't know why anyone would want to promote the usage of mailing lists in general. The industry moved on to more centralized solutions like github for a reason - mailing lists are clunky, intuitive, and simply horrible for large discussions. Because old and large projects are using them doesn't mean it's a good reason for new projects to use them today. If anyone has problems with using closed-source platforms like github, there are open-source alternatives like gogs/gitea so you're fully in charge. Abandoning the openness of such platforms in favor of mailing lists would be a big step backwards.
- saagarjha 8y ago> mailing lists are clunky, intuitive, and simply horrible for large discussions On the contrary, I largely prefer mailing lists for non-code discussions (i.e. things that are not code review or filing bugs). When Swift's mailing lists moved to Discourse I realized that I stopped interacting with it as much because it was more inconvenient to work with (especially on mobile).
- chmln 8y agoIf you self-host your own git service, you could email everyone e.g. in a specific organization very easily. On something like GitHub it's nearly impossible, but when you own your data its just a database query + email away.
- Boulth 8y agoYou can write a web hook that'll be called by Github (authenticated with a shared secret) to do that job. Unless I don't understand the use case.
- black-tea 8y agoSmall, one-off projects like Linux, postgres, git? What makes mailing lists worse for large discussions? Decent mail readers support threaded conversations and decent mailing list participants know how to quote properly. This has been around for decades and I don't think github discussions add anything except more noise maybe.
- knolax 8y agoI love the little avatar they have for the site. Little touches like thatare really underrated.
- tambourine_man 8y agoThe mobile version has some issues https://m.imgur.com/a/YYnHXeM https://m.imgur.com/a/YYnHXeM
- chrismorgan 8y agoStep one would be improved with a small bit of JavaScript to sniff the platform and expand the most likely section (and ideally even move it to the top). Please don’t be allergic to small snippets of JavaScript that optionally enhance things. Keyboard and screen-reader accessibility of the radio button accordion technique is completely ruined by the use of `display: none` on the radio buttons. That could be remedied by zero-sizing them instead in one of quite a few ways. Note however that this will make Up/Down arrows switch section instead of scroll as a user might expect—that’s part of why radio buttons are not a good match for this type of widget (to say nothing of improper exposure to accessibility tech). Keyboard accessibility is also poor due to weak and missing focus indication. I would strongly recommend replacing the magic radio button technique with semantically and functionally appropriate <details> elements; then, if you want opening one to close the rest, add a small snippet of JavaScript to that effect. (Then users with JS disabled will be able to open multiple sections, and that’s fine.) The use of various CSS tricks has the side-effect that scroll position doesn’t always act in the way you might expect. I recommend augmenting such cases with small JS snippets to enhance the behaviour.
- jaytaylor 8y agoI wanted so much to like this. The evolution of SirHat (better name :) is entertaining, and never leaving the cmdline would be great! And I was on board until encountering this type of tedium: Find the message ID to reply to. Don't stress too much about getting this step right, but it's a nice Courtesy for the people receiving your patch. On the mailing list Archives, look up the latest email In your thread and expand "Details" to find the Message ID. Copy this for the next step. IMHO, needing to lookup email header IDs for each patch revision is an insane and terrible workflow! (At least, compared to gitbucketlabhub.)
- u801e 8y agoI've configured my email client (Thunderbird) to display it when viewing an email. I can simply right-click on the message-id value and get a context-menu with a "copy message-id" option. Other mail clients should have something similar.
- deleted 8y ago[deleted]
- u801e 8y agoGreat tutorial. You may want to add a section about using git-format-patch to allow one to see the emails on disk and using git-send-email with those files. You may also want to add a caveats section about certain email providers. In my experience, any Microsoft Exchange/O365 server will most likely mangle the email server side (introducing quoted-printable encoding characters or changing the message-id field. Gmail will require that you enable insecure application access in order to use git-send-email. If you don't do that, then using git-send-email will result in a authentication failure error (which you can see if you use the --debug flag).
- ronreagan 8y agoAt Acemyhomeworkwriters we understand that writing papers is very challenging to students. Our writing service is here to help you with this. We guarantee expert tutoring to ensure you ace that class. All our writers who are holders of masters and PhD in various disciplines. Our tutors are vetted, tested and trained before they join the writing panel. Additionally, we have years of experience in offering quality homework help to students from all over the world. Masterly of writing styles is our norm. We pride ourselves in having a dedicated customer support panel, professionally trained writers, as well as skilled editors. Support and writers are ready to help you in tackling that assignment. Visit us on https://acemyhomeworkwriters.com/ https://acemyhomeworkwriters.com/