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

Re: how to display file history?

From
Linus Torvalds <torvalds@osdl.org>
Date
May 15, 2006, 16:15 UTC
Message-ID
<Pine.LNX.4.64.0605150900510.3866@g5.osdl.org>
In-Reply-To
<m1ejyv7077.fsf@ebiederm.dsl.xmission.com>
On Mon, 15 May 2006, Eric W. Biederman wrote:
> 
> So that it has a chance of being remembered, and eventually fixed
> the man pages of git-whatchanged and git-log only sort of tell you
> that this is even possible.

I don't think this is a man-page issue. I think this is a very basic tutorial issue.

People still don't seem to realize how flexible (and powerful) the git revision specifications are. It's not just limiting by path, all of these work on _all_ of the "history tools" (whether they be gitk, qgit, "git log", "git whatchanged" or your own home-cooked stuff):

 - "revision based limiting"
	"a..b", but also "a ^b ^c ^d" or "a --not b c d" for the more 
	complex case where you're interested in one (or more) commit, but 
	not anything that flows from any of a number of other commits.
	"--all".
 - "commit date based limiting"
	"--since=2.weeks.ago" "--since=aug.5th"
 - "limit by number of hits"
	"-15"
 - "limit by type or state"
	"--no-merges" and "--unpacked"
And finally
 - "limit by pathname"
and you can combine all of these.
So
	gitk --all --since=1.month -15 -- t/

will show at most fifteen commits from _any_ branch that changed the test subdirectory in the last month.

And yeah, maybe that isn't a very interesting query, but it's easy to explain and understand, so it's worth explaining early.

And it should be equally obvious to everybody that if it works for "gitk", that means that it works for "qgit", "git log" and "git whatchanged" too, ie this is a very core concept, and not just some tacked-on thing for one special tool.

			Linus
Previous: Eric W. BiedermanNext: Eric W. Biederman
Message 4 of 12 in “RE: how to display file history?”
  1. Brown, LenMay 15, 2006
  2. Junio C HamanoMay 15, 2006
  3. Eric W. BiedermanMay 15, 2006
  4. Linus TorvaldsMay 15, 2006
  5. Eric W. BiedermanMay 15, 2006
  6. Linus TorvaldsMay 15, 2006
  7. J. Bruce FieldsMay 15, 2006
  8. Jonas FonsecaMay 21, 2006
  9. Marco CostalbaMay 15, 2006
  10. Linus TorvaldsMay 15, 2006
  11. Marco CostalbaMay 15, 2006
  12. Linus TorvaldsMay 15, 2006

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.