From: Konstantin Khomoutov Date: Thu, 27 Jul 2023 17:13:34 GMT Subject: Re: [QUESTION] how to diff one blob with nothing Message-ID: <20230727171334.6qg2xtecvmplg3or@carbon> In-Reply-To: >> If you haven't created one, of course it would fail. It should help >> to do >> >> $ git hash-object -w --stdin > >> before running >> >> $ git diff 00750edc e69de29bb >> > > This is a viable solution, but it's a bit ugly since a read-only "diff" > requires ”write“ an empty blob. You could probably just do git cat-file -s e69de29bb to figure out whether a blob is empty. What is your end goal? Do you indeed want to produce a "trivial patch" which merely "adds" all the lines of the blob you'd like to compare to an empty one (assuming the blob conains text)?