[Dune] Limited utility commit reference [Was: Re: [Dune-devel] DGFGridFactory deprecated?]

Christoph Grüninger christoph.grueninger at iws.uni-stuttgart.de
Mon Dec 22 15:14:01 CET 2014


Hi Bård,
thanks for your explanations, their are welcome! I added an according
section "Referring to a commit by its hash" to our Git best practices
guide in the Dune user wiki [1].
Please feel free to make further suggestions about our Git use and
extend/edit the wiki.

Bye
Christoph

[1]
http://users.dune-project.org/projects/main-wiki/wiki/Git_best_practices


Am 19.12.2014 um 18:20 schrieb Bård Skaflestad:
> On 19/12/14 17:38, Christoph Grüninger wrote:
> 
> Hi Christoph,
> 
> Sorry to barge in unannounced and please don't take this the wrong way,
> but I wanted to point out one slight deficiency in the commit reference
> you posted to the Dune mailing list just now.
> 
> In particular, references of the form
> 
>> Git commit …1bcb6f2466
> 
> which give only the *terminating* SHA1 substring, make it just that bit
> more difficult to extract which commit is actually meant and to see its
> log and detailed patch.  Ignoring the fact that a complete URL to the
> Dune repositories was given too, here's the command sequence I had to
> use in order to extract the commit contents in question:
> 
>     $ git show 1bcb6f2466
>     fatal: ambiguous argument '1bcb6f2466': unknown revision [...]
> 
>     $ git log --format='%H' | grep '1bcb6f2466$'
>     918bd99dc1864a898f8d8c342912d51bcb6f2466
> 
>     $ git show 918bd99dc1864a898f8d8c342912d51bcb6f2466
> 
> I personally think the "git log --format='%H'" bit is needlessly
> complicated when a simpler alternative exists.  In particular, the
> *initial* SHA1 substring--typically the first 7 characters of the
> complete SHA1--is often enough to uniquely identify a specific commit.
> This abbreviated reference can then be passed as an argument directly to
> "git show" and return a useful result:
> 
>     $ git show 918bd99
> 
> If you're unsure whether or not the first 7 characters are sufficient,
> you can use "git rev-parse --short --verify" to look into the uniqueness
> of those references.  For instance,
> 
>     $ git rev-parse --short --verify \
>         918bd99dc1864a898f8d8c342912d51bcb6f2466
>     918bd99
> 
> 
> Sincerely,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20141222/153e7aae/attachment.sig>


More information about the Dune mailing list