LWN: Comments on "Git v2.23.0 released" https://lwn.net/Articles/796563/ This is a special feed containing comments posted to the individual LWN article titled "Git v2.23.0 released". en-us Mon, 20 Oct 2025 12:46:44 +0000 Mon, 20 Oct 2025 12:46:44 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Git v2.23.0 released https://lwn.net/Articles/797521/ https://lwn.net/Articles/797521/ flussence <div class="FormattedComment"> The big difference is that git-svn's author mapping only applies to `git svn` subcommands. That means things like init and fetch; it mutates incoming commits. On top of that it has to be asked for explicitly and only supports a svn-specific mapping (single name + email lookup per svn username).<br> <p> .mailmap is on-by-default and has a standard location, the root directory of a repo, meaning it can usefully be distributed that way. Git itself has one (<a href="https://github.com/git/git/blob/master/.mailmap">https://github.com/git/git/blob/master/.mailmap</a>) that provides good examples of what it's useful for.<br> </div> Wed, 28 Aug 2019 02:40:09 +0000 Git v2.23.0 released https://lwn.net/Articles/797226/ https://lwn.net/Articles/797226/ ceplm <div class="FormattedComment"> What’s the difference between .mailmap and authors-file from git-svn?<br> </div> Mon, 26 Aug 2019 08:33:16 +0000 switch and restore https://lwn.net/Articles/796671/ https://lwn.net/Articles/796671/ newren <div class="FormattedComment"> <font class="QuotedText">&gt; (*) by me. However since I'm not likely to continue contributing to</font><br> <font class="QuotedText">&gt; git, what will be implemented in the future is not something I can</font><br> <font class="QuotedText">&gt; comment on.</font><br> <p> No Duy, don't leave us! You make so many awesome contributions. Look at how much we'd miss out on:<br> <p> $ git shortlog -sn --no-merges v2.16.0..v2.23.0 | head<br> 724 Nguyễn Thái Ngọc Duy<br> 446 Jeff King<br> 337 Johannes Schindelin<br> 250 brian m. carlson<br> 248 Stefan Beller<br> 242 Ævar Arnfjörð Bjarmason<br> 227 Derrick Stolee<br> 217 Elijah Newren<br> 173 SZEDER Gábor<br> 170 Junio C Hamano<br> <p> 724 commits all over the tree. Sigh. If you do end up moving to greener hills elsewhere, just know that your contributions have been greatly appreciated.<br> </div> Mon, 19 Aug 2019 17:33:39 +0000 switch and restore https://lwn.net/Articles/796651/ https://lwn.net/Articles/796651/ nybble41 <div class="FormattedComment"> You can also look at the reflog. There will be a message like "HEAD@{xx}: checkout: moving from branchA to branchB", which is useful if you've changed branches multiple times.<br> </div> Mon, 19 Aug 2019 15:49:18 +0000 switch and restore https://lwn.net/Articles/796590/ https://lwn.net/Articles/796590/ mathstuf <div class="FormattedComment"> There is `git checkout -` (I imagine `git switch -` exists too) that checks out the previous branch (akin to `cd -` changing to `$OLDPWD`).<br> </div> Mon, 19 Aug 2019 12:17:16 +0000 switch and restore https://lwn.net/Articles/796589/ https://lwn.net/Articles/796589/ epa <div class="FormattedComment"> Thanks, I sent a message to that address requesting some safe default behaviour for 'git restore' (a bit like 'git clean', which is safe by default despite its specific purpose of deleting local files). I also suggested that 'git switch' print out the old branch you are leaving, as a reminder for when you go back to it later.<br> </div> Mon, 19 Aug 2019 09:42:56 +0000 switch and restore https://lwn.net/Articles/796585/ https://lwn.net/Articles/796585/ pclouds <div class="FormattedComment"> switch/restore author here. Just wanted to clarify a few things.<br> <p> While git-switch does update the working tree, it does it as part of the branch switching process. And this is a safe operation, if git-switch may lead to content loss, it's aborted and you have to give more options (like --force) to continue.<br> <p> git-restore is the other half of git-checkout to delete changes in worktree or in the index. This has always been a dangerous operation. And it remains so even after git-restore is split from git-checkout.<br> <p> However, I marked these two commands as experimental for a reason. Git UI is often complained on the Internet. The experimental status allows git devs to change these commands behavior at will until they consider it stable. And feedback is important. Please drop a mail at git@vger.kernel.org if you want to change how these commands work. I think anything is still possible at this point.<br> <p> For how to make git-restore less dangerous. These ideas have been brought up (*). When you're doing a complex restore, --dry-run could be added to show you exactly what will be restored. And in case you make a mistake, if git makes backup for all restored files, it's possible to undo the the restore. This is less annoying than the "safe mode by default". If you restore files often enough you may end up always adding "-f" to disable safe mode anyway and mistakes will still happen. A proof of concept (called backup-log) was made to explore this direction.<br> <p> (*) by me. However since I'm not likely to continue contributing to git, what will be implemented in the future is not something I can comment on.<br> </div> Mon, 19 Aug 2019 05:10:41 +0000 switch and restore https://lwn.net/Articles/796570/ https://lwn.net/Articles/796570/ epa <div class="FormattedComment"> Disentangling the overloaded 'git checkout' into separate 'git switch' and 'git restore' looks like a useful improvement to git's usability, though it will require some new muscle memory. This blog post talks about them: <a href="https://github.blog/2019-08-16-highlights-from-git-2-23/">https://github.blog/2019-08-16-highlights-from-git-2-23/</a><br> <p> As I understand it, 'git switch' does still do both functions: switches branches and checks out, sorry, 'restores' the file contents from the new branch into your working directory.<br> <p> I think 'git restore' is probably still a bit misnamed since it won't just restore files which are missing from the working directory, but overwrite whatever is currently there (with no way to undo that). So 'git restore .' is still a dangerous command to run. I would have preferred a safe 'restore' command (which will restore missing files you deleted, but will not overwrite local changes) and an explicit force flag. Or is it now safer than the old 'git checkout'? The manual page <a href="https://git-scm.com/docs/git-restore">https://git-scm.com/docs/git-restore</a> is not completely clear.<br> </div> Sun, 18 Aug 2019 16:55:34 +0000 Git v2.23.0 released https://lwn.net/Articles/796564/ https://lwn.net/Articles/796564/ flussence <div class="FormattedComment"> The mailmap thing got in, great!<br> </div> Sun, 18 Aug 2019 16:02:37 +0000