Nouveautés de Git 1.8.5

Nicola Paolucci
Nicola Paolucci
Retour à la liste

En attendant la prochaine livraison majeure de Git qui intègrera d'importantes mises à jour, examinons les notes de la dernière livraison : Git 1.8.5 est arrivé !

Here is what I could dig from the release notes that was interesting to me in my role of average git user.

Oh and if you haven't seen them yet check out my earlier notes on releases 1.8.2, 1.8.3 and 1.8.4.

Pointeurs d'installation habituels

J'ai l'habitude de fournir quelques pointeurs pour la mise à niveau, avec des mises en garde et des rappels concernant les gestionnaires de package qui, dans certains cas, peuvent retarder la distribution. Mais ce n'est pas de mon ressort. Quoi qu'il en soit, vous trouverez ci-dessous des instructions faciles à exécuter pour effectuer la mise à niveau :

  • Type brew update && brew upgrade git if you use homebrew on OSX.
  • Use a magic apt trick if on Ubuntu based distributions (I leave other distributions as an exercise for the reader).
  • Simply run the new installer if on Windows (the Windows port sometimes lags a bit behind so please be patient if you can't find it right away).

HEAD new alias is finally live

This had been cooking for a while and it's finally in: HEAD has a new alias, instead of typing four capital letters you can say "@" now, e.g. "git log @".

Some rebase polish

La commande rebase a été améliorée :

  • In the operations sheet of the --interactive rebase the list of commit ids will now conform to the core.abbrev length (core.abbrev is the configuration that holds how long the abbreviated hashes of the commits should be, the default being 7).

  • You can now customize if git pull --rebase should use the default flattening or preserve merges by modifying setting pull.rebase to preserve. For more details on what this and rebase --preserve-merges do, please check Stack Overflow's answer.

Tiny status improvements

Varied improvements to git status have been included in this release:

  • Certaines informations inutiles sur le statut ne sont plus imprimées pour les submodules pour lesquels submodule.$name.ignore est égal à « all ».

  • During a cherry-pick it shows what original commit is being picked.

  • It will not spit out its output prepended by # comment markers. If you require scripts to parse the output of git status you should now update them to use git status --porcelain.

  • git status and git branch -v -v now distinguish among a branch that does not build on any other branch, a branch that is in sync with the branch it builds on, and a branch that is configured to build on some other branch that no longer exists.

Diff for "all-but" classes

git diff --diff-filter could already filter several classes of changes:

Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type
(i.e. regular file, symlink, submodule, ...) changed (T), are Unmerged (U), are Unknown (X), or have had
their pairing Broken (B). Any combination of the filter characters (including none) can be used. When *
(All-or-none) is added to the combination, all paths are selected if there is any file that matches other
criteria in the comparison; if there is no file that matches other criteria, nothing is selected.

It can can now take lowercase letters to mean show everything but these classes.

Variables HTTP par site

  • The "http.*" variables can now be specified per URL that the configuration applies. For example the following would flip http.sslVerify off only when talking to that specified site:
sslVerify = true
[http ""]
sslVerify = false

Sensibilisation aux mouvements de submodules

Submodule support has been steadily improving with every release, this time git gains the ability to relocate submodules:

'git mv A B' when moving a submodule A has been taught to relocate its working tree and to adjust the paths in the .gitmodules file.

Performance, implémentation interne, etc.

  • Le transport HTTP essayera d'utiliser le TCP Keepalive lorsqu'il le pourra.

  • git repack is now written in C.

Autres fonctionnalités utiles

Les notes de livraison contiennent d'autres fonctionnalités utiles :

  • git whatchanged deprecated but not removed. It's been made less prominent in the general part of the documentation.
  • git cherry-pick now understands git cherry-pick - to pick from the previous branch.
  • xdg-open can be used as a browser backend for git web-browse (hence to show git help -w output), when available.
  • Just like make -C <directory>, git -C <directory> ... tells Git to go there before doing anything else.
  • Make foo^{tag} to peel a tag to itself, i.e. no-op., and fail if "foo" is not a tag. git rev-parse --verify v1.0^{tag} would be a more convenient way to say test $(git cat-file -t v1.0) = tag.
  • git push --no-thin actually disables the "thin pack transfer" optimization.
  • Magic pathspecs like ":(icase)makefile" that matches both Makefile and makefile and ":(glob)foo/**/bar" that matches "bar" in "foo" and any subdirectory of "foo" can be used in more places.
  • git blame can now take more than one -L option to discover the origin of multiple blocks of the lines.
  • Les clients de transport HTTP peuvent éventuellement demander d'enregistrer les cookies avec la variable de configuration http.savecookies.
  • git fetch (hence "git pull" as well) learned to check fetch.prune and remote.*.prune configuration variables and to behave as if the --prune command line option was given.

That's it for now. Let me know if you find this update useful and stay tuned for more. Follow me @durdn and the awesome @AtlDevtools team for more DVCS rocking.

Prêt à découvrir Git ?

Essayez ce tutoriel interactif.

Démarrez maintenant