From: Philip Oakley Date: Mon, 02 Sep 2013 22:13:49 GMT Subject: Re: [PATCH v3 07/11] Documentation/replace: tell that -f option bypasses the type check Message-ID: <857C171CD0E84268B296C9F3FCDFB277@PhilipOakley> In-Reply-To: <20130902215545.GA2668@elie.Belkin> From: "Jonathan Nieder" > Hi, > > Philip Oakley wrote: > >> Does `hash-object` do the inverese of `cat-file commit`? >> >> I didn't find the hash-object(1) man page very informative on that >> matter > > Hm. The manpage says: > > Computes the object ID value for an object with specified type > with the contents of the named file [...], and optionally writes > the resulting object into the object database. > > And then: > > -w > Actually write the object into the object database. > > Any ideas for making this clearer? The problem is the file format, in the sense that the earlier `git cat-file commit $orig` has a human readable output which is a description of the commit header, rather than the specific binary content. I couldn't tell if the command would cope with such a human readable file. In Christian's quick untested script he'd matched the two commands as opposites, which doesn't appear to be the case, and I'm somewhat ignorant of what hash-object is doing - I'd expect that it simply hashed the already constructed data, but my ignorance starts showing at this point ;-) regards Philip