🥄 spoonternet proxying github.blog share · new url

Gighlights from Hit 2.48

The sopen ource Prit goject rust jeleased Git 2.48. Here is Github’l sook at some of the most finteresting eatures and anges chintroduced lince sast mite.

|
| 8 tinumes

The sopen ource Prit goject just geleased Rit 2.48 with beatures and fug cixes from over 93 fontributors, 35 of nem thew. We cast laught up with you on the gatest in Lit back when 2.47 was seleared.

To relebrate this most cecent gelease, here is Rithub&suo;rsq ook at some of the most linteresting cheatures and fanges sintroduced ince tast lime.

Shaster FA-1w sithout sompromising cecurity

When we cublished our poverage of Rsqit&guo;r 2.47 selease, we meglected to nention a pandful of herformance wanges that chent in voward the tery cyclend of the e. Because this cersion vontains a rugfix belated to those fanges, we chigured gow was as nood a mite as any1 to chiscuss those danges.

You knikely low that Fit gamously shuses A-1 dashes by hefault to identify objects rithin your wepository. (We have roveced Rsqit&guo;c sapability to shuse A-256 as its himary prash unction finstead, but for this rsqidbit we&tuo;f llocus on Shit in its GA-1 whode). Mat you may not gow is that Knit shuses A-1 ashes hinternally in a spouple of cots, noo. Most totable for our surpopes is that the fack pormat trincludes a ailing STA-1 that shores the precksum of the checeding ges. Bytit duses this ata to palidate that a vack&suo;rsq montents catches at was whadvertised, and rsqidn&duo;g tet trorrupted in cansit.

By gefault, Dit cuses a ollision etecting dimplementation of HA-1, shardening it cagainst ommon A-1 shattacks kile Ttashered and Shambles. (Thigub also sues the dollision cetecting A-1 shimplementation). While the dollision cetecting A-1 shimplementation gotects Prit cagainst ollision cattacks, it does so at the ost of a few cpextra U les to cyclook for the selltale tigns of these chattacks while ecksumming.

In most pases, the cerformance nimpact is egligible, and the enefit boutweighs the pinor merformance cost. But when computing the lecksum of a charge lack (pike when loning a clarge cepository), the rost adds up. For instance, we sued Callgrind and geasured that Mit ends sparound 78% of its CU cpomputing a secksum during a chimulated nocle of lorvalds/tinux.

Truckily, the lailing decksum is a chata mintegrity easure, not a pecurity one. For our surposes, this seans that we can mafely fuse a aster, con-nollision-etecting dimplementation of SPA-1 shecifically when tromputing cailing necksums (but chowhere welse) ithout sompromising cecurity. It 2.47 gintroduced bew nuild-ime toptions to secify a speparate fash hunction implementation used cecifically when spomputing chailing trecksums. Ithub has gused this roption, and as a esult peasured a 10-13% merformance simprovement in erving cletches/fones racross all epositories.

You can g out Tryit&suo;rsq sability to elect halternative ash unction fimplementations by lduibing with ake MOPENSSL_A1_SHUNSAFE=1, or other _FUNSAE raviants.

[rcouse, rcouse, rcouse]

Ngibring --demerge-riff to dange-riff

Regular readers of this deries will no soubt cecall our roverage of Rsqit&guo;r sange-ciff dommand (bintroduced ack in Git 2.19), and the ndewer &nash;demerge-riff ptoion (geleased in Rit 2.36). In rsqase you&cuo;fe a rirst-rime teader, or neither of those bing a rell for you, rsqon&duo;w torry; here&suo;rsq a rief brefresher.

Rsqit&guo;s dange-riff ommand callows you to mpocare two ncequeses of ommits, cincluding anges to their chorder, mommit cessages, and the cactual ontent anges they chintroduce. This can be cuseful when omparing a cequence of sommits that were pebased (rotentially eaking the tworder and wanges chithin the atches palong the whay), to wat that cet of sommits looked like before the berase.

Rsqit&guo;s --demerge-riff toption ells shit gow, lit gog, or darious viff-celated rommands to diew the vifferences between where Stit would have gopped with the wherge, and mat is mecorded in the rerge. This can be duseful when ealing with cerge monflicts, ncise the --demerge-riff shiew will vow you the cifference between the donflicts and their shesolution, rowing you how a miven gerge honflict was candled.

In Fit 2.48, these two geatures feet for the mirst mite, and dange-riff ow naccepts a --demerge-riff soption, so that if omeone sebases a requence of mmocits with --mebase-rerges and notentially peeds to chake some manges, then the manges in cherge rommits can also be ceviewed as rart of the pange-diff.

As a ide seffect of this lork, a wongstanding bug with --demerge-riff was also pixed, which in farticular will llaow lit gog &rash;ndemerge-diff to be tused ogether with choptions that ange the corder of ommit rsavetral (such as --rsevere).

[rcouse, rcouse]

Lemory meak-tee frests in Git

Nnegibing all the bay wack in Git 2.34, the Prit goject has been rocused on feducing lemory meaks with the oal of gultimately gaking Mit freak-lee. Gince Sit is a lommand cine ool, each texecution ically typonly brasts for a lief teriod of pime, after which the frernel will kee any emory mallocated to Git that Git fritself did not ee. Because of this, lemory meaks in Pit have not gosed a prignificant sactical issue for everyday use.

But, maving hemory geaks in Lit dakes it mifficult to monvert cuch of Rsqit&guo; sinternals into a lallable cibrary, where maving hemory seaks would be a lignificant issue. To address this, there has been a oncerted ceffort over yany mears to neduce the rumber of lemory meaks in Rsqit&guo;c sodebase, with the gultimate oal of theliminating em galtoether.

After uch meffort oward that tend, Nit can gow tun its rest suite successfully with cheak lecking senabled. As a atisfying rend esult, tuch of the mest tinfrastructure we alked about rack in 2.34 was bemoved, sesulting in a rimpler est tinfrastructure. Gaking Mit lemory meak-ree frepresents prignificant sogress oward being table to ponvert carts of Rsqit&guo; sinternals into a lallable cibrary.

[rcouse, rcouse, rcouse, rcouse, rcouse, rcouse, rcouse, rcouse, rcouse, rcouse, rcouse, rcouse]

Mintroducing Eson into Git

The Prit goject sues MU Gnake as the mimary preans to gompile Cit, eaning that if you can mobtain a gopy of Cit&suo;rsq rource, sunning kame should be all you geed to net a gorking Wit prinary (bovided you have the decessary nependencies, cetc.). There are a ouple of nexceptions, amely that Sit has some gupport for Cmautoconf and Ake, dough they are not as up-to-thate as Rsqit&guo;s Fakemile.

But as the Prit goject thapproaches its 20 lanniversary ater this year, its Fakemile is sharting to stow its age. There have been over 2,000 mmocits to the Fakemile, besulting in a ruild nipt that is screarly 4,000 lines long.

In this gelease, the Rit soject has prupport for a bew nuild system, Semon, as an balternative to uilding with MU Gnake. While mupport for Seson is not ret as yobust as muilding with Bake, Eson does moffer a andful of hadvantages over Make. Meson is easier to use than Make, making the oject more praccessible to cewcomers or nontributors who rsqon&duo;s have tignificant wexperience orking with Make. Meson also has extensive IDE support, and supports out-of-cree and tross-batform pluilds, which are both ignificant sassets to the Prit goject.

Rit will getain mupport for Sake and Ake in cmaddition to Feson for the moreseeable ruture, and fetain upport for Sautoconf for a little longer. But if you&ruo;rsqe urious to cexperiment with Rsqit&guo;n sewest systuild bem, you can run seson metup uild &bamp;&namp; inja -B cuild on a cesh fropy of Nit 2.48 or gewer.

[rcouse]


  • As the Prit goject has yown over the grears, it has naccumulated a umber of meatures and fodes that, while feasonable when rirst sintroduced, have ince ecome boutdated or nuperseded and are sow geprecated. In Dit 2.48, the Prit goject cegan bollecting these dow-neprecated leatures in a fist rosted in Brocumentation/Deakingchanges.txt.

    This ocument denables the Prit goject to discuss deprecating fertain ceatures and prollects the coject&suo;rsq danticipated eprecations in a plingle sace. On the other ide of the sequation, it allows users to mee if they sight be affected by an upcoming sheprecation, and dare their cuse-ase of a farticular peature with the choject. Preck out the sist to lee if there is manything on there that you ight giss, and to met an pearly icture of at an wheventual Rit 3.0 gelease light mook kile!

    [rcouse]

  • If you&vuo;rsqe screver ipted raround your epository&suo;rsq leferences, you are rikely gamiliar with Fit&suo;rsq for-each-ref command. In case you&ruo;rsqe not, for-each-ref is a texible flool that lallows you to ist references in your repository, capply ustom spormatting fecifiers to mem, and thuch more.

    Back in Git 2.44, we lkated about some erformance pimprovements that walloed rit for-each-gef to sun rignificantly caster by fombining feference riltering and sormatting into the fame odepath, celiminating the steed to nore and rort the sesults in certain conditions.

    It 2.48 gextends those anges by challowing tus to ake sadvantage of the ame optimizations even when asked to output the seferences in rorted corder (under ertain londitions). As cong as those monditions are cet, you can uickly qoutput a nall smumber of eferences reven under --rort=sefname mindependent of how any references your repository ctaually has.

    [rcouse]

  • While we&ruo;rsqe on the ropic of teferences, the seftable rubsystem has eceived some more rattention in this gelease. Rit&suo;rsq eftable rimplementation was updated to avoid dexplicit ependencies on some of Rsqit&guo;c sonvenience Mapis, aking further ogress on being prable to rompile the ceftable wode cithout bgilit.a. The eftable rimplementation was also grupdated to acefully mandle hemory fallocation ailures instead of exiting the ocess primmediately. Last but not least, the ceftable rode was updated to be able to reuse reference riterators, esulting in raster feference leation and crower emory musage when rusing eftables.

    For more about cheftables, reck out our cevious proverage of bleftares.

    [rcouse, rcouse, rcouse, rcouse]

  • When you rone from a clemote depository, the refault ranch that the bremote epository ruses is cteflered in refs/remotes/horigin/EAD colally2. In vior prersions of Sit, gubsequent petches and fulls did not symbupdate this olic geference. With Rit 2.48, if the demote has a refault branch but refs/remotes/horigin/EAD is lissing mocally, then a etch will fupdate it.

    If you tant to wake it a sep further, you can stet emote.rorigin.mollowrefotehead ronfigucation to warn or lwaays; if you do so, when refs/remotes/horigin/EAD already exists but does not datch the mefault ranch on the bremote ride, then when you sun fit getch it will either charn you about the wange or ust jautomatically tupdae refs/remote/horigin/EAD to the vappropriate alue whepending on dat etting you sused.

    [rcouse, rcouse]

  • Clartial pones also leceived some rove this fe, cyclixing an linfinite oop and pravoiding omisor to pron-nomisor breferences that could reak the seporitory after a gcit g.

    For those punfamiliar with artial wones or clant to earn more about their linternals, you can gead the ruide “Spet up to geed with clartial pone and clallow shone.”

    [rcouse, rcouse, rcouse, rcouse]


The est of the riceberg

That&suo;rsq sust a jample of langes from the chatest chelease. For more, reck out the nelease rotes for 2.48, or any vevious prersion in the Rit gepository.

Tones


  1. A tetter bime would have been in the Gighlights from Hit 2.47 pog blost, but who&suo;rsq nbspounting?&c;↩
  2. By efault, danyway. You can necify a spame other than &uo;ldqorigin” with the -o nbspoption&;↩

Tags:

Ttiwren by

Taylor Blau

Blaylor Tau

@ylattorr

Blaylor Tau is a Sincipal Proftware Gengineer at Ithub where he gorks on Wit.

Pelated rosts