While using git over the past few weeks a couple of questions have arisen.
1 - When doing a 'git commit' where does one, by convention, put the comment? Does it go before all the comments, after them, or what? I know it doesn't actually matter at all but I'd still like to know.
2 - What is 'git diff' invoking as a pager, and why? E.g. see the following:-
chris$ git diff mychanges stable diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class index 5075c60..01f15a5 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -774,8 +774,8 @@ if (!class_exists('setting_dirchoice')) { if ($entry == '.' || $entry == '..') continue; if ($this->_pattern && !preg_match($this->_pattern,$entry)) continue;
- $file = (is_link($this->_dir.$entry)) ? readlink($this->_dir.$entry) : $this->_dir.$fil - if (is_dir($file)) $list[] = $entry; + $file = (is_link($this->_dir.$entry)) ? readlink($this->_dir.$entry) : $entry; + if (is_dir($this->_dir.$file)) $list[] = $entry; } closedir($dh); } (END)
That (END) is a prompt waiting for me to do something to exit. This is on a 60 line high terminal window so the pager is unnecessary anyway! The real problem was that it took me quite a while to find out how to exit.
On 2 September 2011 17:57, Chris G cl@isbd.net wrote:
1 - When doing a 'git commit' where does one, by convention, put the comment? Does it go before all the comments, after them, or what? I know it doesn't actually matter at all but I'd still like to know.
The comment(s)? You mean the commit message?
If you mean the commit message, then the first line is used. You can optionally have additional lines after a blank line.
Lines starting with # are ignored.
2 - What is 'git diff' invoking as a pager, and why? E.g. see the following:-
You'd want to have a look at the 'core.pager' git config option. git help config has some info. pager.<cmd> option also.
It's not set here, nor is the environment variable, so it seems Git uses less as default.
- Srdjan
On Fri, Sep 02, 2011 at 06:16:58PM +0100, Srdjan Todorovic wrote:
On 2 September 2011 17:57, Chris G cl@isbd.net wrote:
1 - When doing a 'git commit' where does one, by convention, put the comment? Does it go before all the comments, after them, or what? I know it doesn't actually matter at all but I'd still like to know.
The comment(s)? You mean the commit message?
Yes, sorry, I meant the commit message.
If you mean the commit message, then the first line is used. You can optionally have additional lines after a blank line.
OK, convention is that it goes at the start, thank you.
Lines starting with # are ignored.
2 - What is 'git diff' invoking as a pager, and why? E.g. see the following:-
You'd want to have a look at the 'core.pager' git config option. git help config has some info. pager.<cmd> option also.
It's not set here, nor is the environment variable, so it seems Git uses less as default.
Yes, it seems to be using less. It's just that it is acting differently from what I'm used to and I wondered what was going on.