git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] git diff -q option removal

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Jul 17, 2013, 20:05 UTC
Message-ID
<51E6F8F3.6020404@googlemail.com>
In-Reply-To
<7vvc496ruf.fsf@alter.siamese.dyndns.org>
On 07/17/2013 07:04 PM, Junio C Hamano wrote:
> Builtins link all sorts of stuff from outside, e.g. diff.c and
> diffcore-*.c at the toplevel.  I do not see diff_no_index.c is any
> different, so I am probably not understanding your question.

Thanks for the explanation. I am not yet very used to gits code structure. So I sometimes think of 'how would I structure things', so I was confused of things in builtin using some parts outside of it. Maybe that folder raised to much expectations for me to be 'the real' core, whereas the files outside, i.e. those files in the top level directory, are just there for other things or scripts. This understanding of the structure seems obviously wrong now.

Thanks for clarification.
Show 7 quoted lines
> 
> Hmm, do you really get that error message?  I think you would get
> 
>     fatal: ambiguous argument 'no_file': unknown revision or path not in the working tree.
> 
>> 	echo $?
>> 	1
Ok here we go (using current origin/master 9c3c367):
	cd $(mktemp -d)
	echo "test" > actual_file
	git diff actual_file no_file
	# error: Could not access 'no_file'
	echo $?
	1
	
	## I get the same message as well, if I'm using -- or not.
	## also the -q doesn't make a change
	git init 
	git diff -q -- actual_file no_file
	echo $?
	# 0
	git diff  -- actual_file no_file
	echo $?
	# 0
	git diff  actual_file no_file
	# fatal: no_file: no such path in the working tree.
	# Use 'git <command> -- <path>...' to specify paths that do not exist locally.
	echo $?
	# 128
	git diff -q  actual_file no_file
	# fatal: no_file: no such path in the working tree.
	# Use 'git <command> -- <path>...' to specify paths that do not exist locally.
	echo $?
	128
So apparently git diff behaves differently if not in a repo, which is what I tested.
> 
> The command line parsing infrastructure has changed vastly since
> "show-diff" days (see below for a history lesson);
A very interesting read, much appreciated. :)
Show 5 quoted lines
> 
> If we wanted to make "-q" follow the spirit of its original addition
> to "show-diff" again, we could internally add a diff-filter when the
> "-q" option is parsed.
> 

I'm rather new to the project, so my opinion may not have much weight, I'll state it anyway: Keeping backwards compatibility is really hard, because you need the knowledge of such history lessons as read above, to understand what should happen, like having an intuitive feeling about such parameters. Hence maintaining/evolving the project will become harder and harder (specially for newcomers). So having one and only one way to achieve the desired output, which fits into the greater structure as it's the case with --diff-filter is easier to remember for both the user and developers.

Hence I think keeping the -q option would only make sense for the plumber layer, because there the explicit promise was given to not change stuff every other release.

Stefan
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 25 in “daemon.c:handle: Remove unneeded check for null pointer.”
  1. 1/4 daemon.c:handle: Remove unneeded check for null pointer.Stefan Beller, Jul 14, 2013
  2. 2/4 commit: Fix a memory leak in determine_author_infoStefan Beller, Jul 14, 2013
  3. Jonathan NiederJul 14, 2013
  4. 3/4 diff-no-index: Remove unused variable.Stefan Beller, Jul 14, 2013
  5. Jonathan NiederJul 14, 2013
  6. 0/2 git diff -q option removalStefan Beller, Jul 16, 2013
  7. 1/2 diff --no-index: remove nonfunctional "-q" handlingStefan Beller, Jul 16, 2013
  8. 2/2 diff: Remove -q to stay silent on missing files.Stefan Beller, Jul 16, 2013
  9. Junio C HamanoJul 17, 2013
  10. Junio C HamanoJul 17, 2013
  11. Stefan BellerJul 17, 2013
  12. 0/6 Deprecating "diff-files -q"Junio C Hamano, Jul 18, 2013
  13. 1/6 diff: pass the whole diff_options to diffcore_apply_filter()Junio C Hamano, Jul 18, 2013
  14. 2/6 diff: factor out match_filter()Junio C Hamano, Jul 18, 2013
  15. 3/6 diff: preparse --diff-filter string argumentJunio C Hamano, Jul 18, 2013
  16. 4/6 diff: reject unknown change class given to --diff-filterJunio C Hamano, Jul 18, 2013
  17. 5/6 diff: allow lowercase letter to specify what change class to excludeJunio C Hamano, Jul 18, 2013
  18. 6/6 diff: deprecate -q option to diff-filesJunio C Hamano, Jul 18, 2013
  19. 7/6 diff: remove "diff-files -q" at Git 2.0 version boundaryJunio C Hamano, Jul 19, 2013
  20. Jonathan NiederJul 19, 2013
  21. Junio C HamanoJul 19, 2013
  22. Jonathan NiederJul 19, 2013
  23. 4/4 diff.c: Do not initialize a variable, which gets reassigned anyway.Stefan Beller, Jul 14, 2013
  24. Jonathan NiederJul 14, 2013
  25. Jonathan NiederJul 14, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.