
Git 2.19.0 released - rbanffy
https://lwn.net/Articles/764552/
======
andy_ppp
Slightly off topic but just thought I'd say, my favourite git shortcut is:
"git checkout -" which toggles between the current and the previous branch
just like cd - does with directories.

What is your favourite git shortcut or feature!?

~~~
asdkhadsj
My favorite _should_ be hooks. They're not exactly a shortcut, but they allow
you to write logic to prevent yourself from doing dumb things.

Namely, I have two I need to write. One preventing master pushing, as
sometimes I forget which branch I'm on if I'm all over the place. And two,
preventing committing past a `wip` commit message. Arguably I shouldn't be
using wip commit messages, but I prefer being able to have a "stash" per
branch, of sorts. If I stashed it, I fear namespace clobbering as well as
forgetting I even had a wip.

~~~
indosauros
I do the exact same thing. I find WIP stash-per-branch very useful when I'm
context switching often between feature branches. I've got two aliases set up
for this -- `git wip` and `git popwip`:

    
    
      $ git config --global alias.wip
      !git add --all && git commit -am 'wip'
    
      $ git config --global alias.popwip
      !git log -1 --pretty=%B | grep -q '^wip$' && git reset HEAD^ || echo 'HEAD is not a wip commit'

~~~
asdkhadsj
To extend this, I might make my CLI show `foo-branch (wip)` if the most recent
commit is a wip. Your alias idea is golden though, definitely using this.
Thank you!

------
Sir_Cmpwn
> * The content-transfer-encoding of the message "git send-email" sends out by
> default was 8bit, which can cause trouble when there is an overlong line to
> bust RFC 5322/2822 limit. A new option 'auto' to automatically switch to
> quoted-printable when there is such a line in the payload has been
> introduced and is made the default.

Nice to see this one land. That was a pretty annoying usability problem for
with the send-email command, and a barrier for people less knowledable about
git using it.

~~~
u801e
I thought most people used git-send-email to send emails generated from
commits with git-format-patch. Do diffs or commit messages contain lines that
exceed 8 kb in length?

~~~
Sir_Cmpwn
Diffs can, sure, so long as the source file has a line like that. I've seen it
for example with data URIs on HTML files.

------
u801e
Looking at the new git range-diff command, it looks like they're doing
something like:

    
    
        diff -u <(git log -p master..fix-typos@{3}) <(git log -p master..fix-typos)
    

We actually have a program at my job that posts links to diffs like this in
Github PRs whenever someone rebases the branch associated with the PR and
force pushes it up to the remote.

~~~
JoshTriplett
The algorithm is much more sophisticated than that; it can match up commits
that get reordered, and notice commits inserted in the middle of the series.

~~~
jordigh
How effective is this? hg has added extra metadata on top with what we call
"changeset evolution", which tracks this renaming information explicitly. git
seems to like to track stuff like this implicitly, such as renaming files. How
effectively can you track commit rewriting if you don't have explicit metadata
to help you?

~~~
JoshTriplett
Quite well, via well-established graph assignment algorithms that look for the
best fits/matches between pairs of commits.

