From: Taylor Blau Date: Fri, 04 Aug 2023 18:34:36 GMT Subject: Re: [QUESTION] how to diff one blob with nothing Message-ID: In-Reply-To: On Fri, Aug 04, 2023 at 10:28:53AM +0200, Christian Couder wrote: > On Fri, Aug 4, 2023 at 6:42 AM ZheNing Hu wrote: > > > Actually, there is no need to support a default empty blob. > > For example, with the command "git diff --no-index /dev/null", > > it can compare a file with /dev/null, but it can only compare > > and not . > > Therefore, using commands like "git diff /dev/null", > > "git diff --no-index /dev/null", or even "git diff --stdin" > > could potentially solve this issue. > > Maybe it would be clearer to have a new option, called for example > "--blob-vs-file", for that then. It could support both: > > $ git diff --blob-vs-file > > and: > > $ git diff --blob-vs-file Hmm. This feels like a case of trying to teach 'git diff' to do too much. Thanks, Taylor