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

Re: GIT 0.99.9

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 31, 2005, 04:05 UTC
Message-ID
<Pine.LNX.4.64.0510302000310.27915@g5.osdl.org>
In-Reply-To
<7v4q6yl6wv.fsf@assigned-by-dhcp.cox.net>
On Sun, 30 Oct 2005, Junio C Hamano wrote:
Show 7 quoted lines
> 
> I've somewhat updated git-rev-list documentation and tried to
> categorize the options into commit selectors and presentation
> modifiers.  The documentation for commands you mentioned in your
> message all talk about them describing only frequently used
> options, and refer the user to rev-list documentation.  I am not
> sure this would be enough.

I don't think people really follow the links or think very abstractly at all in the first place.

So I was thinking more of some explicit examples. I actually think every command should have an example in the man-page, and hey, here's a patch to start things off.

Of course, I'm not exactly "Mr Documentation", and I don't know that this is the prettiest way to do this, but I checked that the resulting html and man-page seems at least reasonable.

And hey, if the examples look like each other, that's just because I'm also not "Mr Imagination".

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---

I think most people understand a lot better from practice than from theory, and that an example of real usage is much more likely to make people udnerstand a command than just listing what it can do.

diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 13a3998..9cac088 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -30,6 +30,24 @@ OPTIONS
 	Show only commits between the named two commits.
 
 
+Examples
+--------
+git log --no-merges::
+
+	Show the whole commit history, but skip any merges
+
+git log v2.6.12.. include/scsi drivers/scsi::
+
+	Show all commits since version 'v2.6.12' that changed any file
+	in the include/scsi or drivers/scsi subdirectories
+
+git log --since="2 weeks ago" -- gitk::
+
+	Show the changes during the last two weeks to the file 'gitk'.
+	The "--" is necessary to avoid confusion with the *branch* named
+	'gitk'
+
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org>
diff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt
index e6f57d9..6c150b0 100644
--- a/Documentation/git-whatchanged.txt
+++ b/Documentation/git-whatchanged.txt
@@ -51,6 +51,20 @@ OPTIONS
 	However, it is not very useful in general, although it
 	*is* useful on a file-by-file basis.
 
+Examples
+--------
+git-whatchanged -p v2.6.12.. include/scsi drivers/scsi::
+
+	Show as patches the commits since version 'v2.6.12' that changed
+	any file in the include/scsi or drivers/scsi subdirectories
+
+git-whatchanged --since="2 weeks ago" -- gitk::
+
+	Show the changes during the last two weeks to the file 'gitk'.
+	The "--" is necessary to avoid confusion with the *branch* named
+	'gitk'
+
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org> and
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index e5ef6d6..eb126d7 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -24,6 +24,19 @@ OPTIONS
 	Some argument not yet documented.
 
 
+Examples
+--------
+gitk v2.6.12.. include/scsi drivers/scsi::
+
+	Show as the changes since version 'v2.6.12' that changed any
+	file in the include/scsi or drivers/scsi subdirectories
+
+gitk --since="2 weeks ago" -- gitk::
+
+	Show the changes during the last two weeks to the file 'gitk'.
+	The "--" is necessary to avoid confusion with the *branch* named
+	'gitk'
+
 Author
 ------
 Written by Paul Mackerras <paulus@samba.org>
Previous: Junio C HamanoNext: Daniel Barkalow
Message 20 of 26 in “GIT 0.99.9”
  1. Junio C HamanoOct 30, 2005
  2. A Large Angry SCMOct 30, 2005
  3. Junio C HamanoOct 30, 2005
  4. A Large Angry SCMOct 30, 2005
  5. Johannes SchindelinOct 30, 2005
  6. Linus TorvaldsOct 30, 2005
  7. rev-list --sparse?Junio C Hamano, Oct 30, 2005
  8. Linus TorvaldsOct 30, 2005
  9. Junio C HamanoOct 30, 2005
  10. Wolfgang DenkOct 30, 2005
  11. Junio C HamanoOct 30, 2005
  12. Wolfgang DenkOct 30, 2005
  13. Junio C HamanoOct 30, 2005
  14. Wolfgang DenkOct 30, 2005
  15. Ryan AndersonOct 30, 2005
  16. Junio C HamanoOct 30, 2005
  17. H. Peter AnvinOct 30, 2005
  18. Linus TorvaldsOct 31, 2005
  19. Junio C HamanoOct 31, 2005
  20. Linus TorvaldsOct 31, 2005
  21. Date-based limits (Was Re: GIT 0.99.9)Daniel Barkalow, Oct 31, 2005
  22. Junio C HamanoNov 1, 2005
  23. Daniel BarkalowNov 1, 2005
  24. rev-list: make --max- and --min-age a bit more usable.Junio C Hamano, Nov 2, 2005
  25. Linus TorvaldsNov 3, 2005
  26. Junio C HamanoNov 3, 2005

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.