* how to track changes of a file
@ 2008-06-16 10:46 bill lam
2008-06-16 10:56 ` Johannes Sixt
0 siblings, 1 reply; 4+ messages in thread
From: bill lam @ 2008-06-16 10:46 UTC (permalink / raw)
To: git
I want to see what had been done to a particular file, so I started with the log,
$ git-log --no-color glinvc03.ijs |grep commit |head -3
commit 23335cf4acadb9f09410f106adbcc2b190fe9c70
commit 31e4f2c519caa9afa2e29ed8ffb40deb62aa972f
commit b515f020d05f2967a7283751c8dd3740de7136a4
I want to know how to,
1. cat the content this file for these 3 versions
2. show the differences between versions,
I use vim to view man page, and git-log without redirection will invoke vim as a
man viewer. Does git-log always use man? Without the --no-color option there
will be some "33m" prepending to some lines, is there any global setting to turn
off color in git-log?
regards,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to track changes of a file
2008-06-16 10:46 how to track changes of a file bill lam
@ 2008-06-16 10:56 ` Johannes Sixt
2008-06-16 15:49 ` bill lam
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2008-06-16 10:56 UTC (permalink / raw)
To: bill lam; +Cc: git
bill lam schrieb:
> I want to see what had been done to a particular file, so I started with
> the log,
>
> $ git-log --no-color glinvc03.ijs |grep commit |head -3
> commit 23335cf4acadb9f09410f106adbcc2b190fe9c70
> commit 31e4f2c519caa9afa2e29ed8ffb40deb62aa972f
> commit b515f020d05f2967a7283751c8dd3740de7136a4
All you neede here probably was just
$ git rev-list -3 -- glinvc03.ijs
> I want to know how to,
> 1. cat the content this file for these 3 versions
$ git show {23335c,31e4f2,b515f0}:glinvc03.ijs
> 2. show the differences between versions,
$ git log -p -2 -- glinvc03.ijs
> I use vim to view man page, and git-log without redirection will invoke
> vim as a man viewer. Does git-log always use man? Without the
> --no-color option there will be some "33m" prepending to some lines, is
> there any global setting to turn off color in git-log?
You have set PAGER=vim in your .profile? Then put
GIT_PAGER=less; export GIT_PAGER
there, too.
-- Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to track changes of a file
2008-06-16 10:56 ` Johannes Sixt
@ 2008-06-16 15:49 ` bill lam
2008-06-16 16:08 ` Johannes Sixt
0 siblings, 1 reply; 4+ messages in thread
From: bill lam @ 2008-06-16 15:49 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
Johannes Sixt wrote:
> $ git rev-list -3 -- glinvc03.ijs
>
>
> $ git show {23335c,31e4f2,b515f0}:glinvc03.ijs
Thank for you help, but these 2 command did not work, did I missing something? I
I use git version 1.5.4.3 on linux.
$ git rev-list -3 -- glinvc03.ijs
usage: git-rev-list [OPTION] <commit-id>... [ -- paths... ]
limiting output:
--max-count=nr
--max-age=epoch
--min-age=epoch
--sparse
--no-merges
--remove-empty
--all
--stdin
--quiet
ordering output:
--topo-order
...
$ git show {23335c,31e4f2,b515f0}:glinvc03.ijs
fatal: ambiguous argument '23335c:glinvc03.ijs': unknown revision or path not in
the working tree.
Use '--' to separate paths from revisions
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to track changes of a file
2008-06-16 15:49 ` bill lam
@ 2008-06-16 16:08 ` Johannes Sixt
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Sixt @ 2008-06-16 16:08 UTC (permalink / raw)
To: bill lam; +Cc: git
bill lam schrieb:
> Johannes Sixt wrote:
>> $ git rev-list -3 -- glinvc03.ijs
>>
>>
>> $ git show {23335c,31e4f2,b515f0}:glinvc03.ijs
>
> Thank for you help, but these 2 command did not work, did I missing
> something? I I use git version 1.5.4.3 on linux.
>
> $ git rev-list -3 -- glinvc03.ijs
> usage: git-rev-list [OPTION] <commit-id>... [ -- paths... ]
Sorry, should have been
$ git rev-list -3 HEAD -- glinvc03.ijs
But this is not intended for daily use anyway. You are better off using
git log family of commands. Eg. if you insist on a 1-commit-per-line
listing, you'd use
$ git log -3 --pretty=oneline -- glinvc03.ijs
> $ git show {23335c,31e4f2,b515f0}:glinvc03.ijs
> fatal: ambiguous argument '23335c:glinvc03.ijs': unknown revision or
> path not in the working tree.
> Use '--' to separate paths from revisions
My guess is that glinvc03.ijs lives in a subdirectory of your repo. Then
you must supply the complete path from the repository root:
$ git show {23335c,31e4f2,b515f0}:some/subdir/glinvc03.ijs
(No, this will not be changed.)
-- Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-16 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-16 10:46 how to track changes of a file bill lam
2008-06-16 10:56 ` Johannes Sixt
2008-06-16 15:49 ` bill lam
2008-06-16 16:08 ` Johannes Sixt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).