Subject: Re: git log --raw abbreviates SHA1s, despite what manual says

From: Matthieu Moy <[email-masked]>
Date: Fri, 15 May 2015 17:08:38 +0200

Ed Avis <[email-masked]> writes:

> The manual page for git-log says:
>
>            The raw format shows the entire commit exactly as stored in the
>            commit object. Notably, the SHA-1s are displayed in full,
>            regardless of whether --abbrev or --no-abbrev are used,

It says "the raw format", not "the --raw option". The paragraph you cite
is under the PRETTY FORMAT section, hence documents what you can give as
argument to --format.

> But this is not quite true.  Here is an example line from 'git log --raw':
>
>     :100644 100644 9a203c9... daa08a7... M  myfilename

But

git log --format=raw generates an output format with full sha1.

Actually, the documentation *is* misleading, but not the part you're
quoting:

  COMMON DIFF OPTIONS
             [...]
         --raw
             Generate the raw format.

It is not very clear that --raw means to generate _the diff_ in raw
format.

Probably this patch to the doc would be an improvement IMHO:

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index ccd4998..0b50717 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -41,8 +41,11 @@ endif::git-format-patch[]
 
 ifndef::git-format-patch[]
 --raw::
-	Generate the raw format.
+	Generate the raw diff format.
 	{git-diff-core? This is the default.}
+ifdef::git-log[]
+	See the "RAW OUTPUT FORMAT" section of linkgit:git-diff[1].
+endif::git-log[]
 endif::git-format-patch[]
 
 ifndef::git-format-patch[]

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/