Git Rev News: Edition 116 (October 31st, 2024)
Welcome to the 116th edition of Git Rev News, a digest of all things Git. For our goals, the archives, the way we work, and how to contribute or to subscribe, see the Git Rev News page on git.github.io.
This edition covers what happened during the months of September and October 2024.
Discussions
Support
-
fatal from
submodule status --recursive
when used withgrep -q
Matt Liberty reported that when he tried using
git submodule status --recursive | grep -q "^+"
on a repo with a submodule, he got an error message like “fatal: failed to recurse into submodule XXX”, where XXX is the name of the submodule.He expected no error message, no output and a 0 exit code from the whole command line as it should have succeeded. He guessed that Git didn’t like that
grep
when used with-q
exits immediately (without printing anything) when there is a match.Phillip Wood replied to Matt saying he assumed that
grep
’s exit broke the pipe betweengit
andgrep
, sogit
received aSIGPIPE
signal which killed it. Phillip suggested consuming the whole output from Git if the exit code from it was wanted.Matt replied to Phillip that he was interested in the exit code from
grep
, not fromgit
, and that Git shouldn’t output any error when its output is connected to a pipe that gets broken, in the same way as theyes
command, for example, doesn’t output any error when piped togrep -q y
.Junio Hamano, the Git maintainer, also replied to Phillip’s first message that the error Git emitted in such a case wasn’t useful to the user.
Matt replied to Junio that he thought no error at all should be emitted as most Unix tools don’t output any error.
Then Phillip replied to Matt’s first reply to him. He asked if all Matt wanted was that
git submodule status
did not print any error message when it receives aSIGPIPE
signal. Matt replied that he wanted both no error message and a 0 exit code from it.Junio replied to Matt that it was reasonable to ask for no error message, but it should be OK if the exit code was related to the
SIGPIPE
message that the Git command received and that killed it. Junio used the example that evenyes
exited with code 130 when killed using the Control-C keys on a terminal.The exit code associated with a signal is ‘128 + the signal number’, for example as the Control-C keys send a
SIGINT
signal, whose signal number is 2, processes killed this way should exit with code ‘128 + 2’, so 130.Eric Sunshine replied to Junio that it wasn’t clear how the exit code from Git was important in the discussion as in the original command line, Git appears before the pipe, so its exit code might be lost.
Matt replied to Eric that the exit code mattered if the
pipefail
shell option was used.Phillip replied to Matt suggesting he remap the exit code associated with
SIGPIPE
, which is 141 (128 + 13), to 0, if he was usingpipefail
but still wanted a 0 exit code. Phillip also gave an example shell function to help with that remapping, and sent a first version of a patch to fix the error message.Junio reviewed that patch and found that it was unnecessarily including the “signal.h” system header.
Phillip fixed that issue in version 2 of the patch which was merged and part of Git v2.47.0.
Developer Spotlight: Chandra Pratap
Editor’s note: Just like in our previous edition, we return with another GSoC retrospective interview in this issue. We hope the reflections shared by GSoC students will provide an insightful perspective that benefits the community. As always, we welcome your thoughts and feedback!
-
Who are you and what do you do?
Hey! I am Chandra Pratap (prefer going by Chand) and I am an undergraduate student of Mathematics at SVNIT, Surat, India. I have a passion for everything computing and like to solve leetcode-styled problems in my free time or contribute to open-source software.
-
How did you initially become interested in contributing to Git, and what motivated you to choose it as your GSoC project?
C was the first programming language that I learnt, and I wanted to try working on a non-trivial software project. I watched a YouTube video on open source and that’s where I got the idea of looking for open-source projects to contribute to. Git and VLC were the only open-source C-written software that I was familiar with and used in day-to-day life, so I decided to start contributing to Git out of the two. By the time GSoC came around, Git was the only open-source community that I was familiar with, so I decided to choose it as my GSoC organization.
-
How do you feel your contribution has impacted the Git community or the broader open-source ecosystem?
My project was about moving and improving reftable tests, so I think my contributions made life somewhat easier for other Git hackers, especially those who frequent the reftable sub-project. My project didn’t really affect any user-facing aspect of Git, so I don’t think it had a huge impact on the broader open-source ecosystem, besides the fact that it gained another lifelong contributor.
-
Is there any aspect of Git that you now see differently after having contributed to it?
Everything, to be honest. Working on and with Git for the duration of my project completely changed my mental model for the tool. Before GSoC, Git was a clunky tool reserved for software development work but post-Git, I know the most frequent commands like the back of my hand, and I’ve already used Git to version control many of my non-software files. I feel like I’ve learnt enough Git to last my entire career.
-
How do you balance your contributions with other responsibilities like work or school?
I had summer vacation for the entire duration of GSoC and no other work commitments, so I had no problems finding time for my GSoC project.
-
Can you share how GSoC helped enhance your technical and non-technical skills (like communication, project management, etc.)?
In terms of technical skills, I think my C and Git skills saw the biggest jump. I am a lot more comfortable working with those two tools than when I was pre-GSoC. Besides that, I’m a lot less scared of the command line now. In terms of non-technical skills, I believe I’ve gotten a lot better at composing mails and communicating with other professionals. I’ve learnt to write with the right amount of professionalism, so I don’t appear too uptight or too lax, the right way to respond to constructive feedback, how to time my schedule to fit with others’, especially those living in other parts of the globe, and how to ask good questions.
-
What was your biggest takeaway or learning from GSoC that you now apply regularly in your work?
I’d say the biggest takeaway from GSoC for me was that it is normal for everyone to face difficulties when trying to learn a new codebase, tool, etc, or even a different part of the same codebase. It is important to persevere and not be afraid of asking questions to achieve the desired results. Other than that, I’ve learnt a lot about good practices in software development, like appropriately splitting commits and writing good commit messages, that I subconsciously incorporate in my work now.
-
What was the biggest challenge you faced during your contributions to Git, and how did you overcome it?
The biggest challenge in contributing to Git was the initial phase of getting involved. I remember starting out working on a small patch for about 2 months with a lot of help from other contributors before it got accepted into Git’s upstream. After a few initial contributions, I grew more confident and could steadily find things to work on and produce acceptable results. The key to overcoming this challenge was to be persistent and patient, and not being afraid of asking silly questions.
-
Have you thought about mentoring new GSoC students?
I’m not sure about being a full-on mentor, but I’d love to co-mentor any future GSoC student(s) interested in working on the reftable project.
-
If you could get a team of expert developers to work full time on something in Git for a full year, what would it be?
The Git GUI tool. I believe that would make Git far more accessible than it currently is and get it incorporated in a lot more people’s day-to-day works.
-
If you could remove something from Git without worrying about backwards compatibility, what would it be?
The packed-refs format for refs seems redundant to me now that reftable is a core part of Git.
-
What is your favourite Git-related tool/library, outside of Git itself?
GitGitGadget was a lifesaver when I had just started contributing to Git, so that is probably my favourite Git related tool.
-
What is your toolbox for interacting with the mailing list and for development of Git?
I used Git’s
send-email
to send patches to the mailing list (especially the--compose
and--annotate
flags) and Gmail’s online client to convey non-patch mails. For developing Git, I used Vim as the editor on an Ubuntu machine and Git as the version control software (duh). -
How do you envision your own involvement with Git or other open-source projects in the future?
I plan on making small contributions to Git from time to time, since I cannot find enough time for larger patches. Other than that, I’ll try to volunteer as a Git mentor for future GSoC or Outreachy cohorts. Regarding other open-source projects, I’ll try contributing to them when I learn a new technology and want a real-world experience.
-
What is your advice for people who want to start Git development? Where and how should they start?
Go through Git’s ‘My First Contribution tutorial’ for the initial setup and to get an idea of what’s it like to work on Git. Then work on a few ‘microprojects’ (more information on the Git Developer’s website) to dip your toes in the Git Development community. From there, you can figure out interesting stuff to work on by yourself.
-
Would you recommend other students or contributors to participate in the GSoC, or other mentoring programs, working on Git? Why? Do you have advice for them?
Yes. I believe that Git is a tool that every working professional can find useful regardless of whether they work in the software industry or not, and working on Git through an open-source program is an excellent way to get good at it in a short period of time. There’s also the added benefit of joining a large and active community of amazingly experienced developers who can teach you a lot about writing software, and the software development workflow in general.
I think the key to getting selected as a participant in GSoC or other mentoring programs is getting involved as early as possible. The more time you allow yourself to get familiar with Git’s codebase and development workflow, the easier it becomes to find an apt project and write a reasonable proposal for it. Also, the initial phase of contributions is the most difficult part of getting involved with an open-source project, so it is better to allow yourself ample time to tackle that initial hurdle.
Other News
Various
- Highlights from Git 2.47
by Taylor Blau on GitHub Blog. Includes features like incremental multi-pack indexes,
%(is-base:)
atom forgit for-each-ref
(see also the Brooke Kuhlmann article, mentioned below), the new “Platform Support Policy” document,git mergetool
directly supporting Visual Studio Code merge tool, and others. - What’s new in Git 2.47.0?
by Justin Tobler on GitLab Blog. Highlights include
init.defaultRefFormat
configuration option that can be set to usereftable
backend (see Beginner’s guide to the Git reftable format),init.defaultObjectFormat
configuration option that can be set tosha256
,git refs verify
, and others. - Tower is running a Git GUIs User’s Survey for people who do not 100% of the time use Git in the terminal.
Light reading
- How Typefully Uses Tower [Git GUI Client] to Conquer Social Media Publishing by Bruno Brito on Tower Blog.
- Moving all our Python code to a monorepo: pytendi.
- Bruno — An API Client Using Git to Fight for Developer Experience by Ryan Reynolds on Tower Blog.
- Using Git as Your Personal To-Do List
by Munem Prionto on DEV.to - more as a way of learning Git by the way of managing
a TODO list, rather than for practical reasons.
- Contrast with Using Git to Manage Todos by Jezen Thomas (2015), mentioned in Git Rev News Edition #9, which is about using Git to help manage TODO or FIXME comments in the codebase (assuming that for example your IDE does not have a plugin for managing TODOs).
- One can also consider using a CLI tool that stores data in plain text files for managing TODOs, like Taskwarrior. Plain text files work well with Git.
- Git For Each Ref
by Brooke Kuhlmann in Alchemists Collective articles.
Learn how to use this command to make use of references
for information dumping, statistics, and much more.
Included in this article is use of the new
is-base
field name recently added in Git 2.47.0. - Searching for and navigating Git commits by Alex Harri on his blog.
- Why some of us like “interdiff” code review
by Austin Seipp (a Gist). Describes problems with the UI of multi-commit GitHub Pull Requests
for responding to reviewer comments by providing a new version of the patch series,
and how
git range-diff
and interactive rebase can help with this task. -
How I Review GitHub PRs by Benjamin Pollack on bitquabit.
- Python PGP proposal poses packaging puzzles by Joe Brockmeier on LWN.net - Sigstore vs OpenPGP. Sigstore was mentioned in Git Rev News Edition #91 and #111.
- A look at the aerc mail client by Joe Brockmeier on LWN.net.
Scientific papers
- Tsukasa Yagi, Shinpei Hayashi: “Toward Interactive Optimization of Source Code Differences:
An Empirical Study of Its Performance”,
arXiv:2409.13590,
with dataset at https://doi.org/10.5281/zenodo.13618978 (but no source code).
- It is based on a prior study: Nugroho, et al.: “How different are different diff algorithms in Git?: Use –histogram for code changes” (2019), https://doi.org/10.1007/s10664-019-09772-z
Git tools and sites
- Reviewing git contributions via email (https://git-am.io/) is a companion piece to interactive guide on sending patches with git send-email (https://git-send-email.io/); the latter was mentioned in Git Rev News Edition #50 #68, and #92.
- “Data Management” section of Awesome MLOps
also includes tools related to versioning data like
- Dolt (Git Rev News #62),
- DVC (first mentioned in Git Rev News #42, then in #63, #64, #100, #107, and #113, among others),
- Dud, improving on DVC, but with narrowed scope,
- Intake (Git Rev News #96),
- See also the discussion in issue #337 in the Intake repository: Data versioning/validation: Comparing Intake with DVC, Quilt and Great Expectations
- lakeFS (Git Rev News #78),
- Quilt / Quilt Data (Git Rev News #99).
- git-task is a local-first task manager/bug tracker that stores everything within your git repository, and which can sync issues to/from GitHub or GitLab. Written in Rust, under MIT license.
- Bruno is a fast and Git-friendly open-source API client,
similar to Postman, Insomnia and similar tools. It stores collections directly
in a folder on your filesystem in a plain text markup language, Bru.
- Compare with Simple Web Application Test (SWAT), web application oriented testing framework, with test plan stored as plain text files in specially named directories.
Releases
- Git 2.47.0, 2.47.0-rc1
- Git for Windows 2.47.0(2), 2.47.0(1), 2.47.0-rc1(1)
- libgit2 1.8.4, 1.8.3
- GitLab 17.5.1, 17.4.3, 17.3.6, 17.5, 17.4.2, 17.3.5, 17.2.9
- Gerrit Code Review 3.10.2, 3.8.9, 3.9.7
- GitHub Enterprise 3.14.2, 3.13.5, 3.12.10, 3.11.16
- GitKraken 10.4.1, 10.4.0
- GitHub Desktop 3.4.8, 3.4.7, 3.4.6
- Garden 1.9.0, 1.8.0
- git-credential-oauth 0.13.3
- GitButler 0.13.8, 0.13.7, 0.13.6
Credits
This edition of Git Rev News was curated by Christian Couder <christian.couder@gmail.com>, Jakub Narębski <jnareb@gmail.com>, Markus Jansen <mja@jansen-preisler.de> and Kaartic Sivaraam <kaartic.sivaraam@gmail.com> with help from Chandra Pratap, Brooke Kuhlmann, Štěpán Němec and Brandon Pugh.