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

Re: [PATCH v2 0/2] user-manual: new "getting started" section

From
JFJ. Bruce Fields <bfields@fieldses.org>
Date
Nov 17, 2009, 17:28 UTC
Message-ID
<20091117172815.GH31767@fieldses.org>
In-Reply-To
<20091117210625.6117@nanako3.lavabit.com>
On Tue, Nov 17, 2009 at 09:06:25PM +0900, Nanako Shiraishi wrote:
Show 15 quoted lines
> David's proposal introduced two magic tokens STAGE and WORKTREE.
> 
>   git diff STAGE WORKTREE   (like "git diff" today)
>   git diff HEAD WORKTREE    (like "git diff HEAD" today)
>   git diff WORKTREE HEAD    (like "git diff -R HEAD" today)
>   git diff HEAD STAGE       (like "git diff --cached" today)
>   git diff commit STAGE     (like "git diff --cached commit" today)
> 
> This looks nice on surface, but I think the apparent niceness 
> is shallow. If of course has a small problem of introducing an 
> obvious backward incompatibility. You can't use a branch whose 
> name is STAGE anymore, but a deeper problem is that these two 
> magic tokens pretend to be refs. But they do so only to the diff 
> command. I don't see how you can make them sanely be usable to 
> other commands like "git log v1.0.0..WORKTREE".

Doesn't appear that refs have to point to commits; e.g., on the linux project:

	git log v2.6.11-tree..v2.6.32-rc7
	error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not a
	commit
	fatal: Invalid revision range v2.6.11-tree..v2.6.32-rc7

You might be able to add some extra syntax to prevent conflicts with branch names. Uh, :STAGE, :WORKTREE ?? But I think that conflicts with something else. And the "magic tokens" get a little uglier and harder to remember. Bah.

--b.
Previous: Nanako ShiraishiNext: Junio C Hamano
Message 21 of 28 in “user-manual: new "getting started" section”
  1. 0/2 user-manual: new "getting started" sectionFelipe Contreras, Oct 24, 2009
  2. 1/2 user-manual: add global config sectionFelipe Contreras, Oct 24, 2009
  3. 2/2 user-manual: simplify the user configurationFelipe Contreras, Oct 24, 2009
  4. Nanako ShiraishiOct 24, 2009
  5. Felipe ContrerasOct 24, 2009
  6. Björn SteinbrinkOct 24, 2009
  7. Felipe ContrerasOct 24, 2009
  8. Junio C HamanoOct 24, 2009
  9. Junio C HamanoOct 24, 2009
  10. Felipe ContrerasOct 24, 2009
  11. J. Bruce FieldsOct 25, 2009
  12. Junio C HamanoOct 25, 2009
  13. Felipe ContrerasOct 25, 2009
  14. Jonathan NiederOct 25, 2009
  15. Felipe ContrerasNov 11, 2009
  16. Michael J GruberNov 12, 2009
  17. Felipe ContrerasNov 12, 2009
  18. Nanako ShiraishiNov 13, 2009
  19. Felipe ContrerasNov 16, 2009
  20. Nanako ShiraishiNov 17, 2009
  21. J. Bruce FieldsNov 17, 2009
  22. Junio C HamanoNov 17, 2009
  23. Felipe ContrerasNov 17, 2009
  24. Junio C HamanoNov 17, 2009
  25. Felipe ContrerasNov 17, 2009
  26. Junio C HamanoNov 17, 2009
  27. Felipe ContrerasNov 18, 2009
  28. Matthieu MoyNov 17, 2009

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.