* [PATCH] qgit: Default the log window to wider than the file list and set monospaced font @ 2007-02-07 21:38 Andy Parkins 2007-02-08 8:39 ` Marco Costalba 0 siblings, 1 reply; 21+ messages in thread From: Andy Parkins @ 2007-02-07 21:38 UTC (permalink / raw) To: git The log window and changed files list would start at equal sizes. This patch gives them each a horizontal stretch factor making them have a 3:1 ratio. The font for the log viewer is set to "Monospace", but this should really be done in software and given a config setting (perhaps use the patch view font) Signed-off-by: Andy Parkins <andyparkins@gmail.com> --- src/revsview.ui | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/revsview.ui b/src/revsview.ui index 3fb02ee..ad16200 100644 --- a/src/revsview.ui +++ b/src/revsview.ui @@ -55,11 +55,32 @@ <enum>Qt::Horizontal</enum> </property> <widget class="RevDesc" name="textBrowserDesc" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>3</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font" > + <font> + <family>Monospace</family> + </font> + </property> <property name="lineWrapMode" > <enum>QTextEdit::NoWrap</enum> </property> </widget> <widget class="FileList" name="fileList" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="contextMenuPolicy" > <enum>Qt::CustomContextMenu</enum> </property> @@ -72,16 +93,16 @@ <layoutdefault spacing="6" margin="11" /> <customwidgets> <customwidget> - <class>ListView</class> - <extends>QTreeView</extends> - <header>listview.h</header> - </customwidget> - <customwidget> <class>FileList</class> <extends>QListWidget</extends> <header>filelist.h</header> </customwidget> <customwidget> + <class>ListView</class> + <extends>QTreeView</extends> + <header>listview.h</header> + </customwidget> + <customwidget> <class>RevDesc</class> <extends>QTextBrowser</extends> <header>revdesc.h</header> -- 1.5.0.rc1.gf4b6c ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-07 21:38 [PATCH] qgit: Default the log window to wider than the file list and set monospaced font Andy Parkins @ 2007-02-08 8:39 ` Marco Costalba 2007-02-08 9:46 ` Jakub Narebski ` (2 more replies) 0 siblings, 3 replies; 21+ messages in thread From: Marco Costalba @ 2007-02-08 8:39 UTC (permalink / raw) To: Andy Parkins; +Cc: git > > The font for the log viewer is set to "Monospace", but this should > really be done in software and given a config setting (perhaps use the > patch view font) > Thanks Andy for patches, I will apply as soon as I have access to my box, probably this evening. Regarding "Monospace" it should be changeable with Settings menu and should apply _only_ to fixed space font viewers, in our case only patch viewer and file content viewer. Other fonts used in qgit are derived from system wide settings and are changeable with qtconfig tool. If you see Monospace applied to list view or any other widget apart from the above mentioned ones then it's a bug. Thanks Marco ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 8:39 ` Marco Costalba @ 2007-02-08 9:46 ` Jakub Narebski 2007-02-08 10:20 ` Andy Parkins 2007-02-08 10:22 ` Andy Parkins 2 siblings, 0 replies; 21+ messages in thread From: Jakub Narebski @ 2007-02-08 9:46 UTC (permalink / raw) To: git Marco Costalba wrote: >> The font for the log viewer is set to "Monospace", but this should >> really be done in software and given a config setting (perhaps use the >> patch view font) >> > > Thanks Andy for patches, I will apply as soon as I have access to my > box, probably this evening. > > Regarding "Monospace" it should be changeable with Settings menu and > should apply _only_ to fixed space font viewers, in our case only > patch viewer and file content viewer. Shouldn't commit message be also in fixed-width (monospace) font? Sometimes there is ASCII-art used (mainly for diagrams) in commit messages; gitweb uses monospace font for commit messages. -- Jakub Narebski Warsaw, Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 8:39 ` Marco Costalba 2007-02-08 9:46 ` Jakub Narebski @ 2007-02-08 10:20 ` Andy Parkins 2007-02-08 19:06 ` Marco Costalba 2007-02-08 10:22 ` Andy Parkins 2 siblings, 1 reply; 21+ messages in thread From: Andy Parkins @ 2007-02-08 10:20 UTC (permalink / raw) To: git; +Cc: Marco Costalba On Thursday 2007 February 08 08:39, Marco Costalba wrote: > Regarding "Monospace" it should be changeable with Settings menu and > should apply _only_ to fixed space font viewers, in our case only > patch viewer and file content viewer. The log message was the one I changed. Having the log message in variable width breaks any ascii-art in the message. I completely agree about pulling the setting from the config. I'll see if I can find that and post a further patch. > If you see Monospace applied to list view or any other widget apart > from the above mentioned ones then it's a bug. True. I used "Monospaced" as the font as that defaults to the system-wide monospaced font; however it's pretty poor form. I raise my hand - shoot me :-) As I say, I'll try and do better and send a new patch. Andy -- Dr Andy Parkins, M Eng (hons), MIEE andyparkins@gmail.com ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 10:20 ` Andy Parkins @ 2007-02-08 19:06 ` Marco Costalba 2007-02-08 19:12 ` Andy Parkins 0 siblings, 1 reply; 21+ messages in thread From: Marco Costalba @ 2007-02-08 19:06 UTC (permalink / raw) To: Andy Parkins; +Cc: git On 2/8/07, Andy Parkins <andyparkins@gmail.com> wrote: > On Thursday 2007 February 08 08:39, Marco Costalba wrote: > > > Regarding "Monospace" it should be changeable with Settings menu and > > should apply _only_ to fixed space font viewers, in our case only > > patch viewer and file content viewer. > > The log message was the one I changed. Having the log message in variable > width breaks any ascii-art in the message. > > I completely agree about pulling the setting from the config. I'll see if I > can find that and post a further patch. > > > If you see Monospace applied to list view or any other widget apart > > from the above mentioned ones then it's a bug. > > True. I used "Monospaced" as the font as that defaults to the system-wide > monospaced font; however it's pretty poor form. I raise my hand - shoot > me :-) As I say, I'll try and do better and send a new patch. > > I have applied and pushed all your patches. BTW you are referring to qgit4 at Pasky http://repo.or.cz/ site, not the stable qgit in kernel.org repo! I didn't got it unti I tried to apply the patches :-) Hint: Regarding application 'fixed width' font please refer to TYPE_WRITER_FONT variable defined in common.h in your new patch, this is where user choosen font is stored. Not-fixed-width font is set with qtconfig tool. Marco P.S: Yes, I have noted this Qt::convertFromPlainText() misbehaviour, but I don't know if are the spaces that are not escaped correctly by the function or the QTextEdit rendering engine that eats the (escaped) spaces anyway. P.P.S: Give a try to Bitstream Vera Sans Mono as fixed width font, it's muuuuuch better then Monospace IMHO ;-) ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 19:06 ` Marco Costalba @ 2007-02-08 19:12 ` Andy Parkins 2007-02-08 19:29 ` Marco Costalba 0 siblings, 1 reply; 21+ messages in thread From: Andy Parkins @ 2007-02-08 19:12 UTC (permalink / raw) To: git; +Cc: Marco Costalba On Thursday 2007, February 08 19:06, Marco Costalba wrote: > I have applied and pushed all your patches. BTW you are referring to > qgit4 at Pasky http://repo.or.cz/ site, not the stable qgit in > kernel.org repo! My apologies - that was the first one I found when I typed qgit4 repository. > Hint: Regarding application 'fixed width' font please refer to > TYPE_WRITER_FONT variable defined in common.h in your new patch, > this is where user choosen font is stored. Excellent; I'll use that then. More patches coming soon. I hope the git list is the right place for these patches. > P.S: Yes, I have noted this Qt::convertFromPlainText() misbehaviour, > but I don't know if are the spaces that are not escaped correctly by > the function or the QTextEdit rendering engine that eats the > (escaped) spaces anyway. I definitely think this is a bug in Qt; QTextBrowser will show the spaces in HTML mode if <pre> is used, so I don't think it's a fault in QTextBrowser. > P.P.S: Give a try to Bitstream Vera Sans Mono as fixed width font, > it's muuuuuch better then Monospace IMHO ;-) No need to persuade me; that's what I already use. Monospace isn't a font on most systems - it's an alias to the default monospaced font - and for me it's aliased to Bitstream Mono :-) It seems to be done by the following in /etc/fonts/ <alias> <family>Bitstream Vera Sans Mono</family> <family>DejaVu Sans Mono</family> <family>Courier</family> <family>Courier New</family> <family>Andale Mono</family> <family>Luxi Mono</family> <family>Cumberland AMT</family> <family>Nimbus Mono L</family> <family>NSimSun</family> <family>FreeMono</family> <default><family>monospace</family></default> </alias> In case that helps you. Andy -- Dr Andrew Parkins, M Eng (Hons), AMIEE andyparkins@gmail.com ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 19:12 ` Andy Parkins @ 2007-02-08 19:29 ` Marco Costalba 2007-02-08 19:51 ` Marco Costalba 2007-02-08 23:04 ` [PATCH] qgit: Default the log window to wider than the file list and set monospaced font Andy Parkins 0 siblings, 2 replies; 21+ messages in thread From: Marco Costalba @ 2007-02-08 19:29 UTC (permalink / raw) To: Andy Parkins; +Cc: git On 2/8/07, Andy Parkins <andyparkins@gmail.com> wrote: > On Thursday 2007, February 08 19:06, Marco Costalba wrote: > > > I have applied and pushed all your patches. BTW you are referring to > > qgit4 at Pasky http://repo.or.cz/ site, not the stable qgit in > > kernel.org repo! > > My apologies - that was the first one I found when I typed qgit4 > repository. > No problem, stable qgit has less layout problems, probably the only patch I will back port is the fixed font in log viewer. qgit4 seems to have more layout weirdeness also in patch and file tabs. I didn't fixed it until because I'm still wondering if it is enough fixing the layout using stretch factors or bite the bullet and implement a geometry persistent saving with QSettings (Qt4 is quite powerful in this regard), of course saved geometry should work both with maximized and not-maximized window, so perhaps saving panes/splitters factors is better then save absolute value at least for 'internal' widget, and use absolute window geometry only for qgit main window. > > > P.S: Yes, I have noted this Qt::convertFromPlainText() misbehaviour, > > but I don't know if are the spaces that are not escaped correctly by > > the function or the QTextEdit rendering engine that eats the > > (escaped) spaces anyway. > > I definitely think this is a bug in Qt; QTextBrowser will show the > spaces in HTML mode if <pre> is used, so I don't think it's a fault in > QTextBrowser. > Please add dbg(text) line in git.cpp, just below Qt::convertFromPlainText(text) call text.append("\n\n " + colorMatch(c->shortLog(), shortLogRE) + '\n' + colorMatch(c->longLog(), longLogRE)); } text = Qt::convertFromPlainText(text); dbg(text); // highlight SHA's // // added to commit logs, we avoid to call git rev-parse for a possible abbreviated // sha if there isn't a leading trailing space or an open parenthesis and, This will print the converted text as plain string, as you can see there is 'something' instead of spaces but I cannot guess what. > > P.P.S: Give a try to Bitstream Vera Sans Mono as fixed width font, > > it's muuuuuch better then Monospace IMHO ;-) > > No need to persuade me; that's what I already use. Monospace isn't a > font on most systems - it's an alias to the default monospaced font - > and for me it's aliased to Bitstream Mono :-) > > It seems to be done by the following in /etc/fonts/ > > <alias> > <family>Bitstream Vera Sans Mono</family> > <family>DejaVu Sans Mono</family> > <family>Courier</family> > <family>Courier New</family> > <family>Andale Mono</family> > <family>Luxi Mono</family> > <family>Cumberland AMT</family> > <family>Nimbus Mono L</family> > <family>NSimSun</family> > <family>FreeMono</family> > <default><family>monospace</family></default> > </alias> > > In case that helps you. > Thanks ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 19:29 ` Marco Costalba @ 2007-02-08 19:51 ` Marco Costalba 2007-02-08 21:58 ` Andy Parkins 2007-02-08 23:04 ` [PATCH] qgit: Default the log window to wider than the file list and set monospaced font Andy Parkins 1 sibling, 1 reply; 21+ messages in thread From: Marco Costalba @ 2007-02-08 19:51 UTC (permalink / raw) To: Andy Parkins; +Cc: git On 2/8/07, Marco Costalba <mcostalba@gmail.com> wrote: > On 2/8/07, Andy Parkins <andyparkins@gmail.com> wrote: > > On Thursday 2007, February 08 19:06, Marco Costalba wrote: > > > > > I have applied and pushed all your patches. BTW you are referring to > > > qgit4 at Pasky http://repo.or.cz/ site, not the stable qgit in > > > kernel.org repo! > > > > My apologies - that was the first one I found when I typed qgit4 > > repository. > > > > No problem, stable qgit has less layout problems, probably the only > patch I will back port is the fixed font in log viewer. > And also the short log resize mode one, sorry, I forget to mention. BTW it's a little bit funny when you try to resize with mouse the author column and see short log column moving instead :-) Marco ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 19:51 ` Marco Costalba @ 2007-02-08 21:58 ` Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Andy Parkins ` (2 more replies) 0 siblings, 3 replies; 21+ messages in thread From: Andy Parkins @ 2007-02-08 21:58 UTC (permalink / raw) To: git; +Cc: Marco Costalba On Thursday 2007, February 08 19:51, Marco Costalba wrote: > BTW it's a little bit funny when you try to resize with mouse the > author column and see short log column moving instead :-) Yeah, I'm not entirely sure I like it. What I really want, but Qt won't do it is * all columns resizable * default date width to fit contents * columns always take up whole width of view, never introducing a horizontal scrollbar If you want to drop it, I won't be upset. It is very disconcerting, the only thing in that patches favour is that the view starts out basically correct. Andy -- Dr Andrew Parkins, M Eng (Hons), AMIEE andyparkins@gmail.com ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH] qgit4: Add a header and set the font family appropriately to the log message 2007-02-08 21:58 ` Andy Parkins @ 2007-02-08 23:31 ` Andy Parkins 2007-02-08 23:41 ` Shawn O. Pearce 2007-02-09 5:44 ` Marco Costalba 2007-02-08 23:31 ` [PATCH] qgit4: Removed the monospace font override from the log viewer box Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Set a 5:1 stretch ratio on the left and right halves of the patch viewer Andy Parkins 2 siblings, 2 replies; 21+ messages in thread From: Andy Parkins @ 2007-02-08 23:31 UTC (permalink / raw) To: git I've moved the short log to be the first header row, and highlighted it more strongly. I've also set the font family of the log div based on TYPE_WRITER_FONT as suggested by Marco. Signed-off-by: Andy Parkins <andyparkins@gmail.com> --- src/git.cpp | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/git.cpp b/src/git.cpp index 1fa4479..a0873b6 100644 --- a/src/git.cpp +++ b/src/git.cpp @@ -979,15 +979,25 @@ const QString Git::getDesc(SCRef sha, QRegExp& shortLogRE, QRegExp& longLogRE) { text = Qt::convertFromPlainText( c->longLog() ); else { text = "<html><head><style type=\"text/css\">" + "tr.head { background-color: #a0a0e0 }\n" "td.h { font-weight: bold; }\n" "table { background-color: #e0e0f0; }\n" - "div.l { white-space: pre; font-family: Monospace; }\n" - "</style></head><body>\n"; - text.append( "<div class='t'><table>\n" ); - text.append( QString("<tr><td class='h'>Author</th> <td>" + c->author() - + "</td></tr>\n<tr><td class='h'>Date</th><td>") ); + "span.h { font-weight: bold; font-size: medium; }\n" + "div.l { white-space: pre; font-family: "; + text.append( TYPE_WRITER_FONT.family() ); + text.append( "; }\n" + "</style></head><body>\n" ); + + text.append( "<div class='t'><table border=0 cellspacing=0 cellpadding=2>\n" ); + text.append("<tr class='head'> <th colspan=2> <span class='h'>" ); + text.append(colorMatch(c->shortLog(), shortLogRE)); + text.append("</span></th></tr>\n"); + + text.append( QString("<tr><td class='h'>Author</td> <td>" + c->author() + + "</td></tr>\n<tr><td class='h'>Date</td><td>") ); text.append(getLocalDate(c->authorDate())); text.append("</td></tr>\n"); + if (!c->isUnApplied && !c->isApplied) { text.append("<tr><td class='h'>Parent</td> <td>").append(c->parents() .join("</td></tr>\n<tr><td class='h'>Parent</td> <td>")); @@ -1016,8 +1026,7 @@ const QString Git::getDesc(SCRef sha, QRegExp& shortLogRE, QRegExp& longLogRE) { text.append("</td></tr>\n"); } text.append( "</table></div>\n" ); - text.append("\n\n<div class='l'> " + colorMatch(c->shortLog(), shortLogRE) + - '\n' + colorMatch(c->longLog(), longLogRE)); + text.append("\n\n<div class='l'>" + colorMatch(c->longLog(), longLogRE)); text.append( "</div></body></html>\n" ); } // text = Qt::convertFromPlainText(text); -- 1.5.0.rc1.gf4b6c ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit4: Add a header and set the font family appropriately to the log message 2007-02-08 23:31 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Andy Parkins @ 2007-02-08 23:41 ` Shawn O. Pearce 2007-02-08 23:58 ` Junio C Hamano 2007-02-09 5:44 ` Marco Costalba 1 sibling, 1 reply; 21+ messages in thread From: Shawn O. Pearce @ 2007-02-08 23:41 UTC (permalink / raw) To: Andy Parkins; +Cc: git In case you did not already know, --numbered is a wonderful option to git-format-patch. It automatically numbers the commits by placing a sequence into the subject header (e.g. [PATCH 1/3]), making it easier for everyone to know how many patches are in your series. -- Shawn. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit4: Add a header and set the font family appropriately to the log message 2007-02-08 23:41 ` Shawn O. Pearce @ 2007-02-08 23:58 ` Junio C Hamano 2007-02-09 0:29 ` Linus Torvalds 2007-02-09 9:19 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Michael S. Tsirkin 0 siblings, 2 replies; 21+ messages in thread From: Junio C Hamano @ 2007-02-08 23:58 UTC (permalink / raw) To: Shawn O. Pearce; +Cc: Andy Parkins, git "Shawn O. Pearce" <spearce@spearce.org> writes: > In case you did not already know, --numbered is a wonderful option > to git-format-patch. It automatically numbers the commits by placing > a sequence into the subject header (e.g. [PATCH 1/3]), making it > easier for everyone to know how many patches are in your series. This came up before, but when you have more than 9 in your series, we _could_ do [PATCH 01/12] ... [PATCH 12/12] to line them up in e-mail client of the recipients better. Currently I think we do [PATCH 1/12] ... [PATCH 12/12]. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit4: Add a header and set the font family appropriately to the log message 2007-02-08 23:58 ` Junio C Hamano @ 2007-02-09 0:29 ` Linus Torvalds 2007-02-09 0:43 ` [PATCH] format-patch -n: make sorting easier by padding number Johannes Schindelin 2007-02-09 9:19 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Michael S. Tsirkin 1 sibling, 1 reply; 21+ messages in thread From: Linus Torvalds @ 2007-02-09 0:29 UTC (permalink / raw) To: Junio C Hamano; +Cc: Shawn O. Pearce, Andy Parkins, git On Thu, 8 Feb 2007, Junio C Hamano wrote: > > This came up before, but when you have more than 9 in your > series, we _could_ do [PATCH 01/12] ... [PATCH 12/12] to line > them up in e-mail client of the recipients better. Not just "line them up". It's more than just a visual thing. So I long ago I asked Andrew to do that for me in his scripts, because when he sends me 150+ patches in one go, and I want to sort them to be in order, I can't depend on arrival order (because it won't be reliable) and I can't necessarily depend on date order (because he can send more than one patch a second), so what do I do? I sort by subject. But I don't know of a _single_ email reader (and certainly not the one I use) that can "sort numerically by subject, using field #2". So it's a lot easier if the numbering is sorted _alphabetically_ rather than numerically. Otherwise I tend to see things like [PATCH 1/89] [PATCH 10/89] [PATCH 11/89] ... [PATCH 2/89] [PATCH 20/89] [PATCH 21/89] ... (note that this was mostly a problem just when syncing with Andrew: if the patch series is just in the teens or something, it may not sort easily, but you can just pick out the individual emails in order. When you have hundreds of patches, suddenly you realize that computers sorting them for you is really convenient). Linus ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH] format-patch -n: make sorting easier by padding number 2007-02-09 0:29 ` Linus Torvalds @ 2007-02-09 0:43 ` Johannes Schindelin 2007-02-09 0:47 ` Johannes Schindelin 0 siblings, 1 reply; 21+ messages in thread From: Johannes Schindelin @ 2007-02-09 0:43 UTC (permalink / raw) To: Linus Torvalds; +Cc: Junio C Hamano, git Now, when format-patch outputs more than 9 patches, the numbers are padded accordingly. Example: [PATCH 009/167] The 9th patch of a series of 167 Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> --- On Thu, 8 Feb 2007, Linus Torvalds wrote: > On Thu, 8 Feb 2007, Junio C Hamano wrote: > > > > This came up before, but when you have more than 9 in your > > series, we _could_ do [PATCH 01/12] ... [PATCH 12/12] to line > > them up in e-mail client of the recipients better. > > Not just "line them up". It's more than just a visual thing. How about this? Yes, it calculates the width over and over again, but it's not like it's a really performance critical part. log-tree.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/log-tree.c b/log-tree.c index 85acd66..89c29e2 100644 --- a/log-tree.c +++ b/log-tree.c @@ -102,6 +102,16 @@ static int append_signoff(char *buf, int buf_sz, int at, const char *signoff) return at; } +static unsigned int log10(unsigned int number) +{ + unsigned int i = 10, result = 1; + while (i < number) { + i *= 10; + result++; + } + return result; +} + void show_log(struct rev_info *opt, const char *sep) { static char this_header[16384]; @@ -155,7 +165,8 @@ void show_log(struct rev_info *opt, const char *sep) if (opt->total > 0) { static char buffer[64]; snprintf(buffer, sizeof(buffer), - "Subject: [PATCH %d/%d] ", + "Subject: [PATCH %0*d/%d] ", + log10(opt->total), opt->nr, opt->total); subject = buffer; } else if (opt->total == 0) ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] format-patch -n: make sorting easier by padding number 2007-02-09 0:43 ` [PATCH] format-patch -n: make sorting easier by padding number Johannes Schindelin @ 2007-02-09 0:47 ` Johannes Schindelin 0 siblings, 0 replies; 21+ messages in thread From: Johannes Schindelin @ 2007-02-09 0:47 UTC (permalink / raw) To: Linus Torvalds; +Cc: Junio C Hamano, git Hi, On Fri, 9 Feb 2007, Johannes Schindelin wrote: > +static unsigned int log10(unsigned int number) > +{ > + unsigned int i = 10, result = 1; > + while (i < number) { D'oh. Make that "<=", please. > + i *= 10; > + result++; > + } > + return result; > +} Ciao, Dscho ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit4: Add a header and set the font family appropriately to the log message 2007-02-08 23:58 ` Junio C Hamano 2007-02-09 0:29 ` Linus Torvalds @ 2007-02-09 9:19 ` Michael S. Tsirkin 1 sibling, 0 replies; 21+ messages in thread From: Michael S. Tsirkin @ 2007-02-09 9:19 UTC (permalink / raw) To: Junio C Hamano; +Cc: Shawn O. Pearce, Andy Parkins, git > Quoting Junio C Hamano <junkio@cox.net>: > Subject: Re: [PATCH] qgit4: Add a header and set the font family appropriately to the log message > > "Shawn O. Pearce" <spearce@spearce.org> writes: > > > In case you did not already know, --numbered is a wonderful option > > to git-format-patch. It automatically numbers the commits by placing > > a sequence into the subject header (e.g. [PATCH 1/3]), making it > > easier for everyone to know how many patches are in your series. > > This came up before, but when you have more than 9 in your > series, we _could_ do [PATCH 01/12] ... [PATCH 12/12] to line > them up in e-mail client of the recipients better. Currently I > think we do [PATCH 1/12] ... [PATCH 12/12]. Like this (lightly tested)? Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> --- diff --git a/log-tree.c b/log-tree.c index 85acd66..6f6aa5a 100644 --- a/log-tree.c +++ b/log-tree.c @@ -102,6 +102,14 @@ static int append_signoff(char *buf, int buf_sz, int at, const char *signoff) return at; } +static int get_width(unsigned nr) +{ + int i; + for (i = 1; nr > 10; ++i) + nr = nr / 10; + return i; +} + void show_log(struct rev_info *opt, const char *sep) { static char this_header[16384]; @@ -155,8 +163,8 @@ void show_log(struct rev_info *opt, const char *sep) if (opt->total > 0) { static char buffer[64]; snprintf(buffer, sizeof(buffer), - "Subject: [PATCH %d/%d] ", - opt->nr, opt->total); + "Subject: [PATCH %0*d/%d] ", + get_width(opt->total), opt->nr, opt->total); subject = buffer; } else if (opt->total == 0) subject = "Subject: [PATCH] "; -- MST ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit4: Add a header and set the font family appropriately to the log message 2007-02-08 23:31 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Andy Parkins 2007-02-08 23:41 ` Shawn O. Pearce @ 2007-02-09 5:44 ` Marco Costalba 1 sibling, 0 replies; 21+ messages in thread From: Marco Costalba @ 2007-02-09 5:44 UTC (permalink / raw) To: Andy Parkins; +Cc: git On 2/9/07, Andy Parkins <andyparkins@gmail.com> wrote: > I've moved the short log to be the first header row, and highlighted it > more strongly. I've also set the font family of the log div based on > TYPE_WRITER_FONT as suggested by Marco. > > Signed-off-by: Andy Parkins <andyparkins@gmail.com> > --- This patch does not apply on my qgit4 repo, it seems it is on the top of a your not published previous patch. Could you please rebase against current public qgi4 repo (git://repo.or.cz/qgit4.git) Other two patches has been applied and pushed. Thanks Marco ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH] qgit4: Removed the monospace font override from the log viewer box 2007-02-08 21:58 ` Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Andy Parkins @ 2007-02-08 23:31 ` Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Set a 5:1 stretch ratio on the left and right halves of the patch viewer Andy Parkins 2 siblings, 0 replies; 21+ messages in thread From: Andy Parkins @ 2007-02-08 23:31 UTC (permalink / raw) To: git The font is now set in software and is made up of both variable and monospaced fonts, therefore this override is no longer appropriate. Signed-off-by: Andy Parkins <andyparkins@gmail.com> --- src/revsview.ui | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/src/revsview.ui b/src/revsview.ui index ad16200..870110e 100644 --- a/src/revsview.ui +++ b/src/revsview.ui @@ -63,11 +63,6 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="font" > - <font> - <family>Monospace</family> - </font> - </property> <property name="lineWrapMode" > <enum>QTextEdit::NoWrap</enum> </property> -- 1.5.0.rc1.gf4b6c ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH] qgit4: Set a 5:1 stretch ratio on the left and right halves of the patch viewer 2007-02-08 21:58 ` Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Removed the monospace font override from the log viewer box Andy Parkins @ 2007-02-08 23:31 ` Andy Parkins 2 siblings, 0 replies; 21+ messages in thread From: Andy Parkins @ 2007-02-08 23:31 UTC (permalink / raw) To: git This stops the file list taking up half the screen by default. The exact ratio is probably not to important, as long as it's not 1:1. Signed-off-by: Andy Parkins <andyparkins@gmail.com> --- src/patchview.ui | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/patchview.ui b/src/patchview.ui index bd723e8..4537dd7 100644 --- a/src/patchview.ui +++ b/src/patchview.ui @@ -132,6 +132,14 @@ <enum>Qt::Horizontal</enum> </property> <widget class="QSplitter" name="splitter" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="orientation" > <enum>Qt::Vertical</enum> </property> @@ -156,6 +164,14 @@ </widget> </widget> <widget class="FileList" name="fileList" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>13</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="contextMenuPolicy" > <enum>Qt::CustomContextMenu</enum> </property> -- 1.5.0.rc1.gf4b6c ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 19:29 ` Marco Costalba 2007-02-08 19:51 ` Marco Costalba @ 2007-02-08 23:04 ` Andy Parkins 1 sibling, 0 replies; 21+ messages in thread From: Andy Parkins @ 2007-02-08 23:04 UTC (permalink / raw) To: git; +Cc: Marco Costalba On Thursday 2007, February 08 19:29, Marco Costalba wrote: > qgit4 seems to have more layout weirdeness also in patch and file > tabs. I didn't fixed it until because I'm still wondering if it is > enough fixing the layout using stretch factors or bite the bullet and > implement a geometry persistent saving with QSettings (Qt4 is quite > powerful in this regard), of course saved geometry should work both > with maximized and not-maximized window, so perhaps saving > panes/splitters factors is better then save absolute value at least > for 'internal' widget, and use absolute window geometry only for qgit > main window. Saving factors is definitely the way to go; and then you may as well use the stretch factors as that's all they are in essence. Setting a 3:1 stretch ratio would be the same as setting 75% and 25% factors. The ideal solution is really to set one of them based on the contents, probably the file list; but that's difficult to do as you don't want excessively deep trees to make the thing stupidly wide. In the end, I think making layouts that work in all situations in near impossible, so I usually just go for stretch factors that make it look reasonable in most situations. > Please add dbg(text) line in git.cpp, just below > Qt::convertFromPlainText(text) call > > text.append("\n\n " + colorMatch(c->shortLog(), shortLogRE) + > '\n' + colorMatch(c->longLog(), longLogRE)); > } > text = Qt::convertFromPlainText(text); > dbg(text); Good idea. I tried it and the problem would seem to be that convertFromPlainText() doesn't do the conversion as completely as it should. The spaces are being left as spaces, but of course when those get passed to the HTML-ish parser of QTextBrowser, the spaces are being swallowed - as with all HTML parsers. I believe it should actually be replacing all the spaces with " " to /really/ do the plain->HTML conversion. However, the point is moot now anyway because I've dropped it in favour of a div with "white-space: pre" set, which does the job. Andy -- Dr Andrew Parkins, M Eng (Hons), AMIEE andyparkins@gmail.com ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] qgit: Default the log window to wider than the file list and set monospaced font 2007-02-08 8:39 ` Marco Costalba 2007-02-08 9:46 ` Jakub Narebski 2007-02-08 10:20 ` Andy Parkins @ 2007-02-08 10:22 ` Andy Parkins 2 siblings, 0 replies; 21+ messages in thread From: Andy Parkins @ 2007-02-08 10:22 UTC (permalink / raw) To: git; +Cc: Marco Costalba On Thursday 2007 February 08 08:39, Marco Costalba wrote: > Regarding "Monospace" it should be changeable with Settings menu and > should apply _only_ to fixed space font viewers, in our case only > patch viewer and file content viewer. Incidentally, regarding monospaced fonts and Qt. While developing these patches I noticed that Qt::convertFromPlainText() swallows leading white space from the lines. I dropped it and used a style sheet to set the font instead; but in case you use it elsewhere I thought you might be interested. Andy -- Dr Andy Parkins, M Eng (hons), MIEE andyparkins@gmail.com ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2007-02-09 9:19 UTC | newest] Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-02-07 21:38 [PATCH] qgit: Default the log window to wider than the file list and set monospaced font Andy Parkins 2007-02-08 8:39 ` Marco Costalba 2007-02-08 9:46 ` Jakub Narebski 2007-02-08 10:20 ` Andy Parkins 2007-02-08 19:06 ` Marco Costalba 2007-02-08 19:12 ` Andy Parkins 2007-02-08 19:29 ` Marco Costalba 2007-02-08 19:51 ` Marco Costalba 2007-02-08 21:58 ` Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Andy Parkins 2007-02-08 23:41 ` Shawn O. Pearce 2007-02-08 23:58 ` Junio C Hamano 2007-02-09 0:29 ` Linus Torvalds 2007-02-09 0:43 ` [PATCH] format-patch -n: make sorting easier by padding number Johannes Schindelin 2007-02-09 0:47 ` Johannes Schindelin 2007-02-09 9:19 ` [PATCH] qgit4: Add a header and set the font family appropriately to the log message Michael S. Tsirkin 2007-02-09 5:44 ` Marco Costalba 2007-02-08 23:31 ` [PATCH] qgit4: Removed the monospace font override from the log viewer box Andy Parkins 2007-02-08 23:31 ` [PATCH] qgit4: Set a 5:1 stretch ratio on the left and right halves of the patch viewer Andy Parkins 2007-02-08 23:04 ` [PATCH] qgit: Default the log window to wider than the file list and set monospaced font Andy Parkins 2007-02-08 10:22 ` Andy Parkins
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.