
Show HN: Learn to use email with Git - ddevault
https://git-send-email.io
======
OJFord
No JS - I was baffled - did not know about `<label for="<target here>">`.
Nice.

[https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/la...](https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/label)

~~~
rhn_mk1
It 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
<a href>

------
jaytaylor
I 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
I'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.

------
bo1024
Can 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).

~~~
treve
The idea is that in order for multiple people to collaborate, most of the time
you will need a service like Github, Bitbucket or perhaps something you can
run yourself.

This is a different workflow. Instead of staying in sync via a hosted service,
people stay in sync and send 'pull requests' via email.

~~~
bo1024
Thanks, this response starts to remove some of my confusion. So it's git
without the server, communicating pushes over email instead. (I guess you
automatically pull whatever is in the emails you get?)

~~~
epse
You get a patch file as an attachment to the email, which you can then apply
to any branch on your local copy that you'd like.

------
sevensor
One 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.

~~~
subway
The Google implementation of application specific passwords is _horrible_.
There's nothing application specific about it -- it's valid for at least mail,
calendar, and contacts, with no way to limit the scope. It ends up being a
password that effectively bypasses all MFA on your Google account. Where do
you store such a password? That's a _powerful_ credential to be regularly
unlocking.

I should be able to create a credential that's valid for just SMTP, with no
IMAP or cal/card access at all.

~~~
Spivak
If you want that level of granularity then you pretty much have to write an
app but it's absolutely possible.

[https://developers.google.com/gmail/api/auth/scopes](https://developers.google.com/gmail/api/auth/scopes)

~~~
subway
Even creating an app, the hoops are non-trivial. Due to the scope required
(gmail.send), app verification and approval is required.

I've been toying with writing a credential helper to obtain the oauth bearer
token, but Authen::SASL::XOAUTH2 still needs to be written so that git-send-
mail knows how to use it.

------
WorldMaker
Something 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
This is actually something I plan on adding to git sooner or later.

------
chrismorgan
Step 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.

------
johntash
Maybe 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
git apply filename.patch

~~~
u801e
It'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.

------
tambourine_man
The mobile version has some issues

[https://m.imgur.com/a/YYnHXeM](https://m.imgur.com/a/YYnHXeM)

------
chmln
This 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.

~~~
black-tea
Small, 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.

~~~
Yaggo
Yeah, I think it's more a cultural problem than technical limitation of email
system. Even many technical users nowadays lack email skills.

------
u801e
Great 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).

------
kbeckmann
Great 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
Good 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
In 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
This 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
Aha! 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.

------
rhn_mk1
The page sets a background color, but not text color. With system theme, I get
white text on white background.

~~~
yellowapple
Looks 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 :)

------
knolax
I love the little avatar they have for the site. Little touches like thatare
really underrated.

