|
|
Subscribe / Log in / New account

What's coming in Git 2.4.0

By Nathan Willis
April 8, 2015

The Git project recently turned ten years old, and a new stable release, version 2.4.0, is due shortly. While the development cycle leading up to Git 2.4 has focused largely on improving polish, there are a handful of interesting new features worth checking out, plus several changes that users need to be aware of for compatibility reasons.

A "preview" release candidate (-rc0) for Git 2.4.0 arrived on March 26; the first official release candidate (-rc1) followed on April 2. The release notes that accompany both announcements highlight a lengthy list of bugfixes (many of which have also been implemented in the current 2.3.x series) as well as a large set of improvements to the official documentation and to the terminal output returned by individual Git commands.

Some of those output fixes could have genuine impact on a user's workflow, of course. To cite one simple example, in previous releases, providing a non-existent name to the --author= parameter when making a commit would result in a rather terse error message that could leave users wondering what the source of the problem is. The new error message makes it explicit that the --author= parameter is at fault.

Output reporting success was improved, too; for example, the git apply --whitespace=fix command now actually returns a message whenever it fixes white-space problems. The release notes point out, though, that some of the changes to output formatting (in particular with git log and git branch) could result in backward incompatibilities. Users that parse the output from these commands in software will need to update their code.

For most users, though, it is new functionality that will attract the most attention. Topping the list for Git 2.4.0 might be the addition of the --atomic option when doing a push. Not to be confused with "the nuclear option," this switch is actually used when the push in question is meant to update more than one reference (say, HEAD and an important remote reference). Adding --atomic ensures that if any of those updates fails, all of the others will fail, too, thus keeping things from getting out of sync.

A push-to-deploy feature was added in Git 2.3, allowing users to use the push command to deploy changes directly onto a running system. That feature has seen some improvement for 2.4, with the user being able to customize the behavior of the server's repository using the push-to-checkout hook. The example included in the patch's documentation involves a hook that lets the server retain any locally-changed files that do not interfere with the changes being pushed. It is not clear at the moment how many people use Git to deploy software on live servers, but additional flexibility is certainly welcome for those who do.

Among the other tools, there are several new features to point out. An --invert-grep option has been added for the log command. As one would surmise from its name, this allows users to search their logs for commits that do not match a particular pattern. There is also a new GIT_TEST_CHAIN_LINT mechanism for use in test scripts. It allows users to check the syntax of their test scripts, hopefully avoiding those situations where a test is silently skipped because of a syntax error, but the resulting silence is interpreted as a passed test.

The status command already included a -v switch to enable verbose output, but that switch only displays a verbose diff between the index file and the current HEAD. Starting with Git 2.4.0, adding a second -v switch will also show a verbose diff of the uncommitted changes. The archive command can now set the text attribute (which specifies the end-of-line style) on the archive files it generates.

There are also a few new configuration options that may prove interesting. The versionsort.prerelease variable can be used to indicate that version numbers like "1.0-pre1" should come before "1.0." The push.followTags configuration variable makes the --follow-tags option the default for pushes.

The 2.4.0 release does not incorporate a large number of new features, but the significant set of small improvements is a testament to just how active the community remains. Git, even at ten years old, is still adapting to new use cases and the needs of new users.

That process does not appear to be slowing down, either. GitHub just announced a new feature that enables support for large files: audio and video, graphics, and data sets. Dubbed Large File Storage, the open-source extension replaces large files in the Git repository with pointers to external storage. No word yet on whether such a feature will find its way upstream, but considering the pace at which Git development moves now, it would not be a surprise, if enough users find it helpful.


to post comments

Large File Storage

Posted Apr 9, 2015 7:06 UTC (Thu) by Felix.Braun (guest, #3032) [Link] (8 responses)

It would have been interesting how git LFS differs from the venerable git-annex.

Large File Storage

Posted Apr 9, 2015 7:58 UTC (Thu) by fishface60 (subscriber, #88700) [Link] (1 responses)

Or indeed git-fat, or any of the other attempts to support large data files in a git repository.

Large File Storage

Posted Apr 9, 2015 8:04 UTC (Thu) by fishface60 (subscriber, #88700) [Link]

Having had a look at how it works, it appears to use exactly the same mechanism as git-fat, where it uses a smudge filter to translate files as they go between the index to the committed tree object.

I'm just concerned that the result will be yet another weird proprietary extension. git-fat at least used the wide-spread rsync daemon as the backend for file storage.

Large File Storage

Posted Apr 9, 2015 13:05 UTC (Thu) by mathstuf (subscriber, #69389) [Link] (5 responses)

Well, git-annex uses symlinks into a repo and broken links indicate files are missing. This obviously doesn't work on Windows or other broken file systems, so instead, files are empty if they are not local in those cases.

One nice thing about git-annex is that I am not required to have the data locally (I use this to rotate out photos from my mobile devices onto my main server while having a few months' worth of photos locally). It also has a semblance of where the data is and can fetch it from any of those places (if it is still available at that time). This is also what allows it to do the "keep X MB local" logic since it can safely delete data it knows is on the server. It would appear to me that git-lfs requires the data to always be available since it uses a smudge filter.

Large File Storage

Posted Apr 27, 2015 15:53 UTC (Mon) by nye (subscriber, #51576) [Link] (4 responses)

>Well, git-annex uses symlinks into a repo and broken links indicate files are missing. This obviously doesn't work on Windows

Why not?

Large File Storage

Posted Apr 27, 2015 16:00 UTC (Mon) by nye (subscriber, #51576) [Link] (3 responses)

>>Well, git-annex uses symlinks into a repo and broken links indicate files are missing. This obviously doesn't work on Windows
>Why not?

Oh wait, I think I've worked it out: It appears that, by default, only administrators can create symlinks on Windows for some crazy reason. This would therefore require either running as an administrator or changing the system security policy, neither of which make for an enjoyable user experience.

Large File Storage

Posted Apr 27, 2015 20:27 UTC (Mon) by mathstuf (subscriber, #69389) [Link] (1 responses)

Also only supported on NTFS (and exFAT?). My Android phone has the "brokenfs" option set and also has empty files sitting there, so maybe exFAT also doesn't support them.

Basically it just means that the Gallery app just shows lots of empty boxes after I sync.

Large File Storage

Posted Apr 28, 2015 9:59 UTC (Tue) by nye (subscriber, #51576) [Link]

>Also only supported on NTFS

Well I wouldn't say that's really a problem - I think NTFS is the only fs Windows can be installed on.

But anyway, surely the use of symlinks is really just an implementation detail that could be replaced with fake symlinks (Cygwin style, or whatever) easily enough if there was a will? I guess there must be bigger (design/conceptual) differences between git-annex and LFS.

The LFS web site certainly looks swanky; it must be good software.

Large File Storage

Posted Apr 27, 2015 20:28 UTC (Mon) by mathstuf (subscriber, #69389) [Link]

As for the administrator, I think it's their way to avoid symlink attacks since ~no applications are prepared for such things.

What's coming in Git 2.4.0

Posted Apr 10, 2015 5:49 UTC (Fri) by bronson (subscriber, #4806) [Link] (1 responses)

Deploying with git is great. I'm pushing to three live servers now, and will be rolling more out soon.

I'm using https://github.com/mislav/git-deploy

Admittedly, the project is mostly stagnant, and `git deploy setup` only wants to set up the master branch. But, the code is simple and deploys are quick. Compared to all the other deploy techniques I've used in the past, it's my favorite so far.

deployment via git

Posted Apr 13, 2015 11:01 UTC (Mon) by robbe (guest, #16131) [Link]

It seems popular enough that there are HOWTO pages about it:
http://gitolite.com/deploy.html

What's coming in Git 2.4.0

Posted Apr 20, 2015 8:14 UTC (Mon) by toyotabedzrock (guest, #88005) [Link] (1 responses)

He should output a second log with just message numbers and a map to link them to standard error category types with uuids so that better descriptions and new more detailed messages can be added and no ones parsing gets broken.

What's coming in Git 2.4.0

Posted Apr 21, 2015 22:51 UTC (Tue) by nix (subscriber, #2304) [Link]

I spy someone who's had too much to do with IBM systems :)


Copyright © 2015, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds