Live data from Hacker News

Highlights from Git 2.28

github.blog

31–40 of 147 posts

Re: Highlights from Git 2.28

#31
post #9

Someone please give me the missing link here: 1. I do `git log` which helpfully pipes to `more` where I can use vim-stsyle search to find the commit I'm interested in. 2. I find the relevant commit. 3. Now I want to `git show` that commit. Currently I double click on the human unreadable commit, copy it, quit `more` to get back to the command line, type `git show`, then paste the commit. Navigate, click-click, shortc…

You could use `git log -p` instead of `git log` so that the diff is included. To navigate efficiently between the commits, you could pre-seed less with a regex that matches commit (and file) lines, so that "n" and "N" jump from one commit (or file) to the next, something like this LESS="-R --pattern ^(commit|diff) " git log -p Delta[1] makes this convenient: delta --navigate. [1] https://github.com/dandavison/delta (…

Wow, this looks incredible.

I currently use diff-so-fancy which is nice enough but as someone who looks at a lot of diffs a day this seems like a big upgrade.

Re: Highlights from Git 2.28

#32
post #9

Someone please give me the missing link here: 1. I do `git log` which helpfully pipes to `more` where I can use vim-stsyle search to find the commit I'm interested in. 2. I find the relevant commit. 3. Now I want to `git show` that commit. Currently I double click on the human unreadable commit, copy it, quit `more` to get back to the command line, type `git show`, then paste the commit. Navigate, click-click, shortc…

If you are using Tmux, you can use thmux-fingers[1] or tmux-thumbs[2], both create Vimium like shortchuts for urls and git hashes that once pressed copy the link to clipboard or the tmux buffer. Then you can just `git show` and `Ctrl-shift-V` or `Ctrl-b ]`. There's a lot of resources that can be yanked with tmux-fingers, kubernetes resources, ips and others [1] https://github.com/Morantron/tmux-fingers [2] https://gi…

But that isn't a standard part of tmux, right?

Re: Highlights from Git 2.28

#33
post #9

Someone please give me the missing link here: 1. I do `git log` which helpfully pipes to `more` where I can use vim-stsyle search to find the commit I'm interested in. 2. I find the relevant commit. 3. Now I want to `git show` that commit. Currently I double click on the human unreadable commit, copy it, quit `more` to get back to the command line, type `git show`, then paste the commit. Navigate, click-click, shortc…

By using a smarter tool. I personally use magit, which solves this problem across all of git, but it's tied to Emacs. tig is a git log browser I've heard good things about that seems to handle this use case very nicely. You may also be able to pervert less into making this easier, e.g. by using lesskey(1) to add a keybinding that runs `git show $(xclip -o)`. I don't know how wise that would be.

I have definitely used Magit in situations where it was the only use of Emacs, working on the version-controlled content itself in content-specific tools such as Xcode or even MS Word.

Re: Highlights from Git 2.28

#34
post #25
post #2

I wonder about which primary branch naming convention they’ll arrive at. “primary” is my personal favorite ;)

It's rather hard to type as it's switching hands a lot; both "master" and "main" are easier to type, and are also shorter (as least "main" would be an improvement in that sense; "primary" would be quite the regression IMO).

That is why the single handed "fred" branch shall be the beacon of all truth.

Until it is accused of being sexist, or too western.

Re: Highlights from Git 2.28

#36
post #9

Someone please give me the missing link here: 1. I do `git log` which helpfully pipes to `more` where I can use vim-stsyle search to find the commit I'm interested in. 2. I find the relevant commit. 3. Now I want to `git show` that commit. Currently I double click on the human unreadable commit, copy it, quit `more` to get back to the command line, type `git show`, then paste the commit. Navigate, click-click, shortc…

I use a text-mode UI like tig or gitui.

Seconding `tig`

Re: Highlights from Git 2.28

#37
post #9

Someone please give me the missing link here: 1. I do `git log` which helpfully pipes to `more` where I can use vim-stsyle search to find the commit I'm interested in. 2. I find the relevant commit. 3. Now I want to `git show` that commit. Currently I double click on the human unreadable commit, copy it, quit `more` to get back to the command line, type `git show`, then paste the commit. Navigate, click-click, shortc…

You could use `git log -p` instead of `git log` so that the diff is included. To navigate efficiently between the commits, you could pre-seed less with a regex that matches commit (and file) lines, so that "n" and "N" jump from one commit (or file) to the next, something like this LESS="-R --pattern ^(commit|diff) " git log -p Delta[1] makes this convenient: delta --navigate. [1] https://github.com/dandavison/delta (…

Hello, thanks for pointing out your tool. I use diff-so-fancy as a pager but I will most definitely try your tool.

Re: Highlights from Git 2.28

#38
post #8
post #3

Earlier quoted context omitted.

I saw somebody on Twitter call theirs "canon", which I've really taken a liking to. It fits nicely in regular speech too :D

Canon is excellent, but I fear it wouldn't catch on due to its religious origins / connotations.

I can appreciate that "canon" is used in religious contexts, but its meaning and origin go back further than that. Wiktionary (hardly the best source, I know) lists three secular meanings before the religious ones begin. The most relevant is this one:

> A group of literary works that are generally accepted as representing a field.

Also, the coinage "fanon" (as in derivative works by a fanbase) comes directly from the treatment of the source material as "canonical". (Frankly, "canonical" is the best argument I can make for "canon".)

Re: Highlights from Git 2.28

#39
post #30

I just came back to git and gitlab from Perforce and while it's felt like coming home and some things are improving around submodules and LFS there's still a lot of rough edges I'd like to see smoothed over. Its not easy to set up git config settings for a distributed team. I assume for security reasons a repo can't configure its own settings just from a pull but even still I want that functionality. Why do I check i…

You can add a small script to your project that you tell people to run the first time after cloning. Then with that script you can setup everything you want. Such as symlinks to git hooks also stored in the repo (so that they stay up to date), or set up the merge tool that you want.

Re: Highlights from Git 2.28

#40
post #9

Someone please give me the missing link here: 1. I do `git log` which helpfully pipes to `more` where I can use vim-stsyle search to find the commit I'm interested in. 2. I find the relevant commit. 3. Now I want to `git show` that commit. Currently I double click on the human unreadable commit, copy it, quit `more` to get back to the command line, type `git show`, then paste the commit. Navigate, click-click, shortc…

You could use `git log -p` instead of `git log` so that the diff is included. To navigate efficiently between the commits, you could pre-seed less with a regex that matches commit (and file) lines, so that "n" and "N" jump from one commit (or file) to the next, something like this LESS="-R --pattern ^(commit|diff) " git log -p Delta[1] makes this convenient: delta --navigate. [1] https://github.com/dandavison/delta (…

The one issue I've seen with using `-p` here is that `git log -p` has worse performance when compared to plain `git log` because it needs to calculate diffs, and when searching in less ends up searching the diff contents (even when this is not desired)
Post reply on HN