Live data from Hacker News

Highlights from Git 2.28

github.blog

91–100 of 147 posts

Re: Highlights from Git 2.28

#91
post #61

I'm a somewhat advanced user of Git. My coworkers use me as a reference when they have a problem of a difficult merge to solve. I don't follow each Git release, but I also didn't notice a great productivity enhancement for a long time. Sure it is a sign of a mature project, but I'd like to know: What's the somewhat recent Git feature that you really improved your productivity?

  git range-diff
Very useful to get an overview of what changed after a rebase.

https://git-scm.com/docs/git-range-diff

Re: Highlights from Git 2.28

#92

Earlier quoted context omitted.

Our team had started a practice of "devbox setup" scripts in each repo a few years ago. They're invaluable. Instead of following pages of instructions in various state of decay, running just one script puts you into the ready state in a few seconds. Any questions about why something is not working has only one answer: run the setup script. Highly recommend this.

I love having idempotent makefile tasks that can do this kind of thing. And as far as "pages of instructions in various states of decay," couldn't agree more that those aren't a good solution. I usually observe those instructions containing lots of terminal commands. I'd rather have those in an executable format, with commenting if explanation is needed. Then it's (usually, hopefully) pretty obvious where something b…

How do you make sure your makefile tasks are idempotent?

Re: Highlights from Git 2.28

#93
post #89

Earlier quoted context omitted.

First, the simple optimization for Linux systems: double-click on the commit hash, q, git show, middle-click to paste. That's a simpler copy-paste. I do that surprisingly often, when browsing repositories. But for a repository I do regular development in, vim with the "fugitive" mode works very well. You can just use :Glog, and browse, hitting enter on a commit to show the full commit, or on a tree to show the tree,…

>> First, the simple optimization for Linux systems: double-click on the commit hash, q, git show, middle-click to paste. That's a simpler copy-paste. I do that surprisingly often, when browsing repositories. Yes, I also double-click on the commit hash and copy it. But I wish there was an incrementing index starting from the top of git log, such that say the 15th commit down, I could just say `git show 15` and see th…

> I wish there was an incrementing index starting from the top of git log, such that say the 15th commit down, I could just say `git show 15` and see that diff, instead of having to copy and paste the commit ID ( and use my mouse )

The 15th commit down can be shown with

    git show HEAD~14
However, since the log itself does not show you the count this has limited utility since you’d have to either manually count or add some additional processing in order to insert counts into the output of git log.

Re: Highlights from Git 2.28

#94
post #89

Earlier quoted context omitted.

First, the simple optimization for Linux systems: double-click on the commit hash, q, git show, middle-click to paste. That's a simpler copy-paste. I do that surprisingly often, when browsing repositories. But for a repository I do regular development in, vim with the "fugitive" mode works very well. You can just use :Glog, and browse, hitting enter on a commit to show the full commit, or on a tree to show the tree,…

>> First, the simple optimization for Linux systems: double-click on the commit hash, q, git show, middle-click to paste. That's a simpler copy-paste. I do that surprisingly often, when browsing repositories. Yes, I also double-click on the commit hash and copy it. But I wish there was an incrementing index starting from the top of git log, such that say the 15th commit down, I could just say `git show 15` and see th…

If you want to navigate without using the mouse, I'd definitely suggest using vim-fugitive, or tig, or any number of git interfaces that let you browse with keyboard shortcuts.

Re: Highlights from Git 2.28

#95

Earlier quoted context omitted.

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.

Easily solved, keep it to the QWERTY home row and make it the "asdf" branch. Could even backronym it to something like All Saved Data Files, maybe.

As a lisp fan, I second this proposal.

https://common-lisp.net/project/asdf/

Re: Highlights from Git 2.28

#96
post #61

I'm a somewhat advanced user of Git. My coworkers use me as a reference when they have a problem of a difficult merge to solve. I don't follow each Git release, but I also didn't notice a great productivity enhancement for a long time. Sure it is a sign of a mature project, but I'd like to know: What's the somewhat recent Git feature that you really improved your productivity?

git diff --color-moved

This makes git diff highlight reindented or moved lines differently.

I use it to get diffs similar to when you pass -w, but with a bit more context.

It takes a bit of experimenting to keep it from looking like a fruit salad, but sometimes you get interesting results.

https://git-scm.com/docs/git-diff#Documentation/git-diff.txt...

Re: Highlights from Git 2.28

#97
post #26

I like that you can change `git init` to have a different default branch name. At work we've renamed all `master` branches to `main`

Just curious - what reasons do people have for not using master?

Though in the context of git, master is not intended to be a reference to master/slave [1], it is ostensibly widely mis-identified as such. The change therefore is being made by many as an attempt to be more inclusive. I pulled this [2] Bitbucket blog entry from the original article if you want to read what they have to say.

1. https://twitter.com/xpasky/status/1271477451756056577?s=20

2. https://bitbucket.org/blog/moving-away-from-master-as-the-de...

Re: Highlights from Git 2.28

#98
post #61

I'm a somewhat advanced user of Git. My coworkers use me as a reference when they have a problem of a difficult merge to solve. I don't follow each Git release, but I also didn't notice a great productivity enhancement for a long time. Sure it is a sign of a mature project, but I'd like to know: What's the somewhat recent Git feature that you really improved your productivity?

git worktree. Godsend if you regularly need to work on multiple branches simultaneously.

What does worktree provide that a fresh local clone doesn't?

Re: Highlights from Git 2.28

#99
post #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.

Symlinked hook is nice but its not a clean cross platform solution. We're a Unity shop so we support Windows, Mac and Linux devs (or like to try).

I just can't help but feel like if this is the common pattern, then it should be built into one of these tools in a more consistent way.

Re: Highlights from Git 2.28

#100
post #80
post #61

I'm a somewhat advanced user of Git. My coworkers use me as a reference when they have a problem of a difficult merge to solve. I don't follow each Git release, but I also didn't notice a great productivity enhancement for a long time. Sure it is a sign of a mature project, but I'd like to know: What's the somewhat recent Git feature that you really improved your productivity?

git switch/git switch -c so much better than git checkout and the confusing switches.

Not for me.

Those confusing switches are already ingrained in my memory (or hidden away behind aliases) and now I find it more confusing that git is recommending new and different commands to do things that I've been doing a fixed way for years.

`git restore ` instead of `git checkout -- `is another one.

Post reply on HN