{"thread":{"id":"13976","subject":"how to track changes of a file","startedAt":"2008-06-16T10:46:49Z","lastAt":"2008-06-16T16:08:35Z","messageCount":4,"participants":["bill lam","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"80014","messageId":"48564499.3050008@gmail.com","threadId":"13976","inReplyTo":null,"subject":"how to track changes of a file","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2008-06-16T10:46:49Z","receivedAt":"2008-06-16T10:46:49Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"I want to see what had been done to a particular file, so I started with the log,\n\n$ git-log --no-color glinvc03.ijs |grep commit |head -3\ncommit 23335cf4acadb9f09410f106adbcc2b190fe9c70\ncommit 31e4f2c519caa9afa2e29ed8ffb40deb62aa972f\ncommit b515f020d05f2967a7283751c8dd3740de7136a4\n\nI want to know how to,\n1. cat the content this file for these 3 versions\n2. show the differences between versions,\n\nI use vim to view man page, and git-log without redirection will invoke vim as a \nman viewer.  Does git-log always use man?  Without the --no-color option there \nwill be some \"33m\" prepending to some lines, is there any global setting to turn \noff color in git-log?\n\nregards,\n"},{"id":"80015","messageId":"485646F9.1030300@viscovery.net","threadId":"13976","inReplyTo":"48564499.3050008@gmail.com","subject":"Re: how to track changes of a file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-06-16T10:56:57Z","receivedAt":"2008-06-16T10:56:57Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"bill lam schrieb:\n> I want to see what had been done to a particular file, so I started with\n> the log,\n> \n> $ git-log --no-color glinvc03.ijs |grep commit |head -3\n> commit 23335cf4acadb9f09410f106adbcc2b190fe9c70\n> commit 31e4f2c519caa9afa2e29ed8ffb40deb62aa972f\n> commit b515f020d05f2967a7283751c8dd3740de7136a4\n\nAll you neede here probably was just\n\n$ git rev-list -3 -- glinvc03.ijs\n\n> I want to know how to,\n> 1. cat the content this file for these 3 versions\n\n$ git show {23335c,31e4f2,b515f0}:glinvc03.ijs\n\n> 2. show the differences between versions,\n\n$ git log -p -2 -- glinvc03.ijs\n\n> I use vim to view man page, and git-log without redirection will invoke\n> vim as a man viewer.  Does git-log always use man?  Without the\n> --no-color option there will be some \"33m\" prepending to some lines, is\n> there any global setting to turn off color in git-log?\n\nYou have set PAGER=vim in your .profile? Then put\n\nGIT_PAGER=less; export GIT_PAGER\n\nthere, too.\n\n-- Hannes\n"},{"id":"80035","messageId":"48568B76.5050108@gmail.com","threadId":"13976","inReplyTo":"485646F9.1030300@viscovery.net","subject":"Re: how to track changes of a file","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2008-06-16T15:49:10Z","receivedAt":"2008-06-16T15:49:10Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"Johannes Sixt wrote:\n> $ git rev-list -3 -- glinvc03.ijs\n> \n> \n> $ git show {23335c,31e4f2,b515f0}:glinvc03.ijs\n\nThank for you help, but these 2 command did not work, did I missing something? I \nI use git version 1.5.4.3 on linux.\n\n$ git rev-list -3 -- glinvc03.ijs\nusage: git-rev-list [OPTION] <commit-id>... [ -- paths... ]\n   limiting output:\n     --max-count=nr\n     --max-age=epoch\n     --min-age=epoch\n     --sparse\n     --no-merges\n     --remove-empty\n     --all\n     --stdin\n     --quiet\n   ordering output:\n     --topo-order\n...\n\n\n$ git show {23335c,31e4f2,b515f0}:glinvc03.ijs\nfatal: ambiguous argument '23335c:glinvc03.ijs': unknown revision or path not in \nthe working tree.\nUse '--' to separate paths from revisions\n"},{"id":"80040","messageId":"48569003.6080406@viscovery.net","threadId":"13976","inReplyTo":"48568B76.5050108@gmail.com","subject":"Re: how to track changes of a file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-06-16T16:08:35Z","receivedAt":"2008-06-16T16:08:35Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"bill lam schrieb:\n> Johannes Sixt wrote:\n>> $ git rev-list -3 -- glinvc03.ijs\n>>\n>>\n>> $ git show {23335c,31e4f2,b515f0}:glinvc03.ijs\n> \n> Thank for you help, but these 2 command did not work, did I missing\n> something? I I use git version 1.5.4.3 on linux.\n> \n> $ git rev-list -3 -- glinvc03.ijs\n> usage: git-rev-list [OPTION] <commit-id>... [ -- paths... ]\n\nSorry, should have been\n\n$ git rev-list -3 HEAD -- glinvc03.ijs\n\nBut this is not intended for daily use anyway. You are better off using\ngit log family of commands. Eg. if you insist on a 1-commit-per-line\nlisting, you'd use\n\n$ git log -3 --pretty=oneline -- glinvc03.ijs\n\n> $ git show {23335c,31e4f2,b515f0}:glinvc03.ijs\n> fatal: ambiguous argument '23335c:glinvc03.ijs': unknown revision or\n> path not in the working tree.\n> Use '--' to separate paths from revisions\n\nMy guess is that glinvc03.ijs lives in a subdirectory of your repo. Then\nyou must supply the complete path from the repository root:\n\n$ git show {23335c,31e4f2,b515f0}:some/subdir/glinvc03.ijs\n\n(No, this will not be changed.)\n\n-- Hannes\n"}]}