Discussion:
Git import newlines in comments
(too old to reply)
Richard Collins
2013-05-27 00:39:20 UTC
Permalink
I'm looking at switching a git repository to fossil.

I've done an export and import and found that fossil is not showing the
newlines from the commit messages.

e.g. the commit message

Fix slow PDF thumbnail generation

Squashed commit of the following:
commit 350fe7521e79a914a54ff384b6ca02a66d5ba136
Author: Richard Collins
...
...

Shows up in the fossil web UI as:

Fix slow PDF thumbnail generation Squashed commit of the following: commit
350fe7521e79a914a54ff384b6ca02a66d5ba136 Author: Richard Collins ...


Which is not that great for long commit messages. I don't know if newlines
are dropped in the import, or if the UI does not htmlize the newlines. Is
there a way to get fossil to import/display the newlines?

---
Richard Collins
Richard Hipp
2013-05-27 00:46:01 UTC
Permalink
Post by Richard Collins
I'm looking at switching a git repository to fossil.
I've done an export and import and found that fossil is not showing the
newlines from the commit messages.
e.g. the commit message
Fix slow PDF thumbnail generation
commit 350fe7521e79a914a54ff384b6ca02a66d5ba136
Author: Richard Collins
...
...
Fix slow PDF thumbnail generation Squashed commit of the following: commit
350fe7521e79a914a54ff384b6ca02a66d5ba136 Author: Richard Collins ...
Which is not that great for long commit messages. I don't know if newlines
are dropped in the import, or if the UI does not htmlize the newlines. Is
there a way to get fossil to import/display the newlines?
Under the Admin/Timeline menu you can select "Plaintext comments on
timeline", among other options.
Post by Richard Collins
---
Richard Collins
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
Isaac Jurado
2013-05-27 15:37:36 UTC
Permalink
Post by Richard Hipp
Post by Richard Collins
I'm looking at switching a git repository to fossil.
I've done an export and import and found that fossil is not showing the
newlines from the commit messages.
e.g. the commit message
Fix slow PDF thumbnail generation
commit 350fe7521e79a914a54ff384b6ca02a66d5ba136
Author: Richard Collins
...
...
Fix slow PDF thumbnail generation Squashed commit of the following: commit
350fe7521e79a914a54ff384b6ca02a66d5ba136 Author: Richard Collins ...
Which is not that great for long commit messages. I don't know if newlines
are dropped in the import, or if the UI does not htmlize the newlines. Is
there a way to get fossil to import/display the newlines?
Under the Admin/Timeline menu you can select "Plaintext comments on
timeline", among other options.
The problem is that the commit message is not shown within <pre> tags,
so even if line feeds are preserved, the browser will discard them as
whitespace.

In my case that's not really an issue (for migrated Mercurial
repositories) but I wonder if introducing markup in commit messages is a
recommended practice around here.

Cheers.

P.S: Apparently, the command line timeline also joins all the message
into a single line. I still have to look through the code to see if
it's done at commit/import time or just at rendering.
--
Isaac Jurado

"The noblest pleasure is the joy of understanding"
Leonardo da Vinci
Richard Hipp
2013-05-27 15:44:19 UTC
Permalink
Post by Isaac Jurado
P.S: Apparently, the command line timeline also joins all the message
into a single line. I still have to look through the code to see if
it's done at commit/import time or just at rendering.
Fossil preserves the commit message text exactly as it is input. All
changes (new-line folding or whatever else) is done at rendering. So you
can add new options (if you are motivated) to make it honor newlines in
commit messages, if that is what you want it to do.

On the web interface, all of the commit message are displayed inside of
<span class='timelineComment'>...</span>. So you can perhaps adjust the
look of comments to your liking by editing the CSS and without having to
touch code.

For the command-line timeline, the commit messages are formatted using code
in the source file "comformat.c". You'll have to change code if you want
to change the command-line timeline formatting. See
http://www.fossil-scm.org/fossil/artifact/4c6ab377?ln for the latest code.
It is not complicated.
--
D. Richard Hipp
***@sqlite.org
s***@gmail.com
2013-05-27 16:36:44 UTC
Permalink
"On the web interface, all of the commit message are displayed inside of
<span class='timelineComment'>...</span>. So you can perhaps adjust the
look of comments to your liking by editing the CSS and without having to
touch code."

This has been a long time nuisance for me.
Can someone provide a CSS example enabling my [CR+LF]'s within the TimeLine
comments?
I prefer this over modifying the code.

Thanks for fossil.
Post by Richard Hipp
Post by Isaac Jurado
P.S: Apparently, the command line timeline also joins all the message
into a single line. I still have to look through the code to see if
it's done at commit/import time or just at rendering.
Fossil preserves the commit message text exactly as it is input. All
changes (new-line folding or whatever else) is done at rendering. So you
can add new options (if you are motivated) to make it honor newlines in
commit messages, if that is what you want it to do.
On the web interface, all of the commit message are displayed inside of
<span class='timelineComment'>...</span>. So you can perhaps adjust the
look of comments to your liking by editing the CSS and without having to
touch code.
For the command-line timeline, the commit messages are formatted using
code in the source file "comformat.c". You'll have to change code if you
want to change the command-line timeline formatting. See
http://www.fossil-scm.org/fossil/artifact/4c6ab377?ln for the latest
code. It is not complicated.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Isaac Jurado
2013-05-27 16:40:05 UTC
Permalink
Post by s***@gmail.com
"On the web interface, all of the commit message are displayed inside of
<span class='timelineComment'>...</span>. So you can perhaps adjust the
look of comments to your liking by editing the CSS and without having to
touch code."
This has been a long time nuisance for me. Can someone provide a CSS
example enabling my [CR+LF]'s within the TimeLine comments?
I prefer this over modifying the code.
You mean, forcing an element to render as preformatted?

.timelineComment {
font-family: monospace;
white-space: pre;
}

Reference:

http://stackoverflow.com/a/9753612/1100958

Regards.
--
Isaac Jurado

"The noblest pleasure is the joy of understanding"
Leonardo da Vinci
s***@gmail.com
2013-05-27 16:47:19 UTC
Permalink
Thanks but I see no changes to my Timeline comments?
Post by Isaac Jurado
Post by s***@gmail.com
"On the web interface, all of the commit message are displayed inside of
<span class='timelineComment'>...</span>. So you can perhaps adjust the
look of comments to your liking by editing the CSS and without having to
touch code."
This has been a long time nuisance for me. Can someone provide a CSS
example enabling my [CR+LF]'s within the TimeLine comments?
I prefer this over modifying the code.
You mean, forcing an element to render as preformatted?
.timelineComment {
font-family: monospace;
white-space: pre;
}
http://stackoverflow.com/a/9753612/1100958
Regards.
--
Isaac Jurado
"The noblest pleasure is the joy of understanding"
Leonardo da Vinci
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Richard Hipp
2013-05-27 16:51:51 UTC
Permalink
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
***@sqlite.org
s***@gmail.com
2013-05-27 16:57:18 UTC
Permalink
Yes, I tried that.
Should there be a prefix to the .timelineComment?
.timelineComment {
font-family: monospace;
white-space: pre;
}
I noticed 'white-space: pre;' is used in other places in the CSS.
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Richard Hipp
2013-05-27 16:58:46 UTC
Permalink
Post by s***@gmail.com
Yes, I tried that.
Should there be a prefix to the .timelineComment?
I did: "span.timelineComment ..". Maybe that makes a difference. I'm not
very knowledgeable about CSS.
Post by s***@gmail.com
.timelineComment {
font-family: monospace;
white-space: pre;
}
I noticed 'white-space: pre;' is used in other places in the CSS.
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
s***@gmail.com
2013-05-27 17:04:17 UTC
Permalink
Just to be explicit, my comments are loaded without markups but do
contain [CRLF]'s.
I am unsure of the presence of my original [CRLF]'s within the timeline
data?

I also tried 'span.timeline...' with no effect.
Should this work on previously loaded comments or only newly added ones?
This would be a simple yet powerful fix for me.
Post by Richard Hipp
Post by s***@gmail.com
Yes, I tried that.
Should there be a prefix to the .timelineComment?
I did: "span.timelineComment ..". Maybe that makes a difference. I'm
not very knowledgeable about CSS.
Post by s***@gmail.com
.timelineComment {
font-family: monospace;
white-space: pre;
}
I noticed 'white-space: pre;' is used in other places in the CSS.
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Richard Hipp
2013-05-27 17:08:01 UTC
Permalink
Post by s***@gmail.com
Just to be explicit, my comments are loaded without markups but do
contain [CRLF]'s.
I am unsure of the presence of my original [CRLF]'s within the timeline
data?
On the web interface, go to the screen that shows a check-in that contains
CRLFs in the comment. Then click on the "manifest" link. (example:
http://www.fossil-scm.org/fossil/artifact/71a916ee9507d6fb). The comment
follows the "C" probably on the first line. \s means space. \n means
newline. Etc. Check to see if your comments contain \r\n.

Or you can click on the "Edit" link, and the decoded comment will
prepopulate the comment editing field. Does it contain your CRNLs?
Post by s***@gmail.com
I also tried 'span.timeline...' with no effect.
Should this work on previously loaded comments or only newly added ones?
This would be a simple yet powerful fix for me.
Post by Richard Hipp
Post by s***@gmail.com
Yes, I tried that.
Should there be a prefix to the .timelineComment?
I did: "span.timelineComment ..". Maybe that makes a difference. I'm
not very knowledgeable about CSS.
Post by s***@gmail.com
.timelineComment {
font-family: monospace;
white-space: pre;
}
I noticed 'white-space: pre;' is used in other places in the CSS.
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
s***@gmail.com
2013-05-27 17:18:48 UTC
Permalink
Ahh! Very cool.
The manifest shows my [CRLF]'s were compressed to [LF]'s = /n, but no
matter. The edit window shows the line feeds properly.
Wish I could get that to cascade to my Timeline view?
Post by Richard Hipp
Post by s***@gmail.com
Just to be explicit, my comments are loaded without markups but do
contain [CRLF]'s.
I am unsure of the presence of my original [CRLF]'s within the timeline
data?
On the web interface, go to the screen that shows a check-in that contains
http://www.fossil-scm.org/fossil/artifact/71a916ee9507d6fb). The comment
follows the "C" probably on the first line. \s means space. \n means
newline. Etc. Check to see if your comments contain \r\n.
Or you can click on the "Edit" link, and the decoded comment will
prepopulate the comment editing field. Does it contain your CRNLs?
Post by s***@gmail.com
I also tried 'span.timeline...' with no effect.
Should this work on previously loaded comments or only newly added ones?
This would be a simple yet powerful fix for me.
Post by Richard Hipp
Post by s***@gmail.com
Yes, I tried that.
Should there be a prefix to the .timelineComment?
I did: "span.timelineComment ..". Maybe that makes a difference. I'm
not very knowledgeable about CSS.
Post by s***@gmail.com
.timelineComment {
font-family: monospace;
white-space: pre;
}
I noticed 'white-space: pre;' is used in other places in the CSS.
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
s***@gmail.com
2013-05-27 17:20:42 UTC
Permalink
I am using fossil v1.25[80bf94e0f7] if that might explain further.
Post by s***@gmail.com
Ahh! Very cool.
The manifest shows my [CRLF]'s were compressed to [LF]'s = /n, but no
matter. The edit window shows the line feeds properly.
Wish I could get that to cascade to my Timeline view?
Post by Richard Hipp
Post by s***@gmail.com
Just to be explicit, my comments are loaded without markups but do
contain [CRLF]'s.
I am unsure of the presence of my original [CRLF]'s within the timeline
data?
On the web interface, go to the screen that shows a check-in that
contains CRLFs in the comment. Then click on the "manifest" link.
(example: http://www.fossil-scm.org/fossil/artifact/71a916ee9507d6fb).
The comment follows the "C" probably on the first line. \s means space.
\n means newline. Etc. Check to see if your comments contain \r\n.
Or you can click on the "Edit" link, and the decoded comment will
prepopulate the comment editing field. Does it contain your CRNLs?
Post by s***@gmail.com
I also tried 'span.timeline...' with no effect.
Should this work on previously loaded comments or only newly added ones?
This would be a simple yet powerful fix for me.
Post by Richard Hipp
Post by s***@gmail.com
Yes, I tried that.
Should there be a prefix to the .timelineComment?
I did: "span.timelineComment ..". Maybe that makes a difference. I'm
not very knowledgeable about CSS.
Post by s***@gmail.com
.timelineComment {
font-family: monospace;
white-space: pre;
}
I noticed 'white-space: pre;' is used in other places in the CSS.
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Richard Hipp
2013-05-27 17:23:45 UTC
Permalink
Post by s***@gmail.com
I am using fossil v1.25[80bf94e0f7] if that might explain further.
Probably not because none of this has changed in ages.

Press Ctrl-U on the timeline page in your browser (Firefox and Chrome -
dunno about others) and see what HTML is coming across. You can probably
also click on the CSS to see what it looks like.
--
D. Richard Hipp
***@sqlite.org
s***@gmail.com
2013-05-27 17:33:23 UTC
Permalink
Ok, I get same results with Chrome or IE.
Even though the edit pane displays [LF]'s, the html source did not show any
within the text section?
I'll monitor this thread to see if any CSS gurus can explain?
Thanks for trying.
Post by Richard Hipp
Post by s***@gmail.com
I am using fossil v1.25[80bf94e0f7] if that might explain further.
Probably not because none of this has changed in ages.
Press Ctrl-U on the timeline page in your browser (Firefox and Chrome -
dunno about others) and see what HTML is coming across. You can probably
also click on the CSS to see what it looks like.
--
D. Richard Hipp
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Isaac Jurado
2013-05-27 18:35:18 UTC
Permalink
Post by s***@gmail.com
I am using fossil v1.25[80bf94e0f7] if that might explain further.
Yes, that explains it. The use of <span class="timelineComment"> was
added here:

http://fossil-scm.org/index.html/info/f9d4e0853b6650294117fd08683aa8358983f974

Which is two months after the version you're running. In your version,
I guess you could try with the ".timelineTableCell" class, although that
will change more than you expect.

Regards.
--
Isaac Jurado

"The noblest pleasure is the joy of understanding."
Leonardo da Vinci
s***@gmail.com
2013-05-27 18:40:35 UTC
Permalink
SuperAwesome! Thanks Isaac and for this topic.
It's like someone cleaned my windshield :))
Wow, another one of my fossil thorns removed so easily.

Thanks for fossil!
Post by Isaac Jurado
Post by s***@gmail.com
I am using fossil v1.25[80bf94e0f7] if that might explain further.
Yes, that explains it. The use of <span class="timelineComment"> was
http://fossil-scm.org/index.html/info/f9d4e0853b6650294117fd08683aa8358983f974
Which is two months after the version you're running. In your version,
I guess you could try with the ".timelineTableCell" class, although that
will change more than you expect.
Regards.
--
Isaac Jurado
"The noblest pleasure is the joy of understanding."
Leonardo da Vinci
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Stephan Beal
2013-05-27 19:39:55 UTC
Permalink
Post by Richard Hipp
Post by s***@gmail.com
Thanks but I see no changes to my Timeline comments?
Your browser might have the old CSS cached. Try pressing Reload.
Also try adding !important to the css:

white-space: pre !important;
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Stephan Beal
2013-05-27 15:44:49 UTC
Permalink
Post by Isaac Jurado
P.S: Apparently, the command line timeline also joins all the message
into a single line. I still have to look through the code to see if
it's done at commit/import time or just at rendering.
It's done in src/comformat.c:comment_print(). It appears to collapse
whitespace just like a browser does, basically. i think i might have
accidentally found a bug, though:

if( doIndent ){
fossil_print("%*s", indent, "");
}

should that "%*s" be "%.*s"? i've never seen "%*s" before. (Anyone who
knows what i'm talking about there, feel free to answer!)
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Richard Hipp
2013-05-27 15:51:23 UTC
Permalink
Post by Stephan Beal
Post by Isaac Jurado
P.S: Apparently, the command line timeline also joins all the message
into a single line. I still have to look through the code to see if
it's done at commit/import time or just at rendering.
It's done in src/comformat.c:comment_print(). It appears to collapse
whitespace just like a browser does, basically. i think i might have
if( doIndent ){
fossil_print("%*s", indent, "");
}
should that "%*s" be "%.*s"? i've never seen "%*s" before. (Anyone who
knows what i'm talking about there, feel free to answer!)
The "fossil_print("%*s", indent, "")" statement prints out indent
characters of white space.
Post by Stephan Beal
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
_______________________________________________
fossil-users mailing list
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
--
D. Richard Hipp
***@sqlite.org
Continue reading on narkive:
Loading...