Fossil

History for src/comformat.c
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/comformat.c

2020-05-05
00:41
[a2e181ec] part of check-in [35046721] diff -y: set the default width automatically based on the terminal width. (check-in: [35046721] user: ashepilko branch: trunk, size: 22031)
2020-04-05
23:45
[0fa23824] part of check-in [06afb702] Match the COMMAND and WEBPAGE names with _cmd and _page functions; forumpost/045bffda68 (check-in: [06afb702] user: ashepilko branch: api-cleanup, size: 22439)
2019-01-27
15:38
[e9fe5da3] part of check-in [a0d10b91] Add the global --comment-format command-line option as an alias for --comfmtflags. (check-in: [a0d10b91] user: florian branch: comment-format-setting, size: 22435)
15:35
[9cf5cabd] part of check-in [bc62fa17] Add the "comment-format" setting to set the default options for printing timeline comments to the console, as discussed here: https://fossil-scm.org/forum/forumpost/d9954370c7. (check-in: [bc62fa17] user: florian branch: comment-format-setting, size: 22410)
2018-11-28
23:43
[e97f8902] part of check-in [cc9c422d] Minor stylistic changes to the comment formatter. (check-in: [cc9c422d] user: drh branch: comment-formatter-utf8, size: 21342)
2018-11-24
07:49
[5d847583] part of check-in [490d38ff] Minor optimizations: drop a few redundant comparisons and calculations, and take advantage of the logical AND short-circuit by testing the least expensive and most unlikely condition first. Also fold away the iterative comments into cross references. (check-in: [490d38ff] user: florian branch: comment-formatter-utf8, size: 21330)
07:16
[cf4a82f3] part of check-in [b86a2fc7] Fix two bugs (introduced with this branch) that become manifest with invalid UTF-8 sequences. (check-in: [b86a2fc7] user: florian branch: comment-formatter-utf8, size: 22191)
2018-11-16
19:39
[8e984136] part of check-in [70dd8f74] Fix a bug (already present on trunk) with the (non-legacy) comment printing algorithm, detected while running the regression tests from test/comment.test with UTF-8 text: the function to print the indent (modified to a calculate-only function on this branch) was handed a pointer to the current line index and the current line index, thus performing checks at (current line index * 2), causing random increments of the current line index. (check-in: [70dd8f74] user: florian branch: comment-formatter-utf8, size: 22151)
14:02
[ec7e42fc] part of check-in [2dca9b82] More coding style fixes. (check-in: [2dca9b82] user: florian branch: comment-formatter-utf8, size: 22184)
11:26
[52c3a796] part of check-in [aadbbb38] Coding style fixes. (check-in: [aadbbb38] user: florian branch: comment-formatter-utf8, size: 22193)
11:14
[d3b5101e] part of check-in [c9ec3d18] For better word breaking results with the (non-legacy) comment printing algorithm, make sure the lookahead to the next space character is UTF-8-aware. Also make sure the per-line remaining character count is decremented properly for UTF-8 sequences. The neuralgic points now handle UTF-8 sequences correctly, and they could be enhanced to work with the effective display width, if required (to handle combining characters, and East Asian Wide and Fullwidth characters). (check-in: [c9ec3d18] user: florian branch: comment-formatter-utf8, size: 22199)
2018-11-15
15:32
[67acfea2] part of check-in [29d3a2ed] Ensure the line buffer for the legacy comment printing algorithm can hold maximum-length UTF-8 sequences. (check-in: [29d3a2ed] user: florian branch: comment-formatter-utf8, size: 20468)
15:16
[d99410c0] part of check-in [b029ed22] Fix a problem with initial indent introduced by the previous check-in, so that all regression tests from test/comment.test now succeed. Also eliminate three more calls to fossil_print(). Regarding performance, the legacy comment printing algorithm is outnumbered by factor 2-3, with these changes. (check-in: [b029ed22] user: florian branch: comment-formatter-utf8, size: 20389)
12:43
[d0f31fe1] part of check-in [16fde3ff] Add output buffering to the (non-legacy) comment printing algorithm, to reduce calls to fossil_print(). The resulting performance improvement can be up to factor 10, with a perceptible difference even for short comments (measured and tested on Windows with MSVC builds, and on Ubuntu with GCC builds). (For comparison: for the legacy comment printing algorithm, the extra UTF-8 checks added by this branch impair performance by 0.12-1.8%, depending on whether the input contains predominantly multi-byte vs. ASCII-only sequences.) (check-in: [16fde3ff] user: florian branch: comment-formatter-utf8, size: 19941)
2018-10-17
14:16
[d6da53c0] part of check-in [1bbca2c3] Modify the comment formatter to avoid output of incomplete UTF-8 sequences, and to avoid line breaks inside UTF-8 sequences. See https://fossil-scm.org/forum/forumpost/1247e4a3c4 for detailed information and tests. (check-in: [1bbca2c3] user: florian branch: comment-formatter-utf8, size: 19408)
2017-11-30
17:58
[4d18073b] part of check-in [e7767de2] Refactor the symlink processing logic so that most of the file access routines take a new parameter indicating the conditions under which symlinks should and should not be followed. This should fix a few bugs related to symlink processing. Lots of testing required before merging to trunk. (check-in: [e7767de2] user: drh branch: symlink-refactor, size: 17161)
2017-06-15
03:37
[ba3c29ae] part of check-in [e6216197] Fix TTY comment line break logic for UTF8 multi-byte characters. (check-in: [e6216197] user: drh branch: trunk, size: 17143)
2015-04-21
07:12
[f570981a] part of check-in [d32ca592] Fix auto-adjust of CLI timeline to terminal width on Linux. Thanks to Warren Young for analysis and patch! (check-in: [d32ca592] user: jan.nijtmans branch: trunk, size: 17120)
2014-10-20
15:01
[24b2de2b] part of check-in [0a7e326f] Add a custom static analysis program that verifies the arguments to printf-style varargs routines used in Fossil. Adjust the source code to be more robust for printf format errors and to fix a few minor problems found by the static checker. (check-in: [0a7e326f] user: drh branch: compile-time-print-checking, size: 17154)
2014-07-24
21:27
[8847b181] part of check-in [d7d26550] Add another flag to the new comment printing algorithm capable of stripping superfluous CR/LFs while preserving other spacing. (check-in: [d7d26550] user: mistachkin branch: trunk, size: 17122)
20:54
[13e999b1] part of check-in [45327338] Fix boundary case in the new comment printing algorithm that sometimes results in extra new lines. (check-in: [45327338] user: mistachkin branch: trunk, size: 15831)
05:56
[b07774f9] part of check-in [8e7d2a65] Improve clarity of the new comment printing algorithm. (check-in: [8e7d2a65] user: mistachkin branch: trunk, size: 15841)
05:05
[339895f0] part of check-in [351de029] Factor out the common terminal width detection code for comment printing into a new function. (check-in: [351de029] user: mistachkin branch: trunk, size: 15756)
03:52
[5cb56208] part of check-in [856c6061] For the new comment printing algorithm, make sure to indent after forcing a line break due to the original comment text being detected. (check-in: [856c6061] user: mistachkin branch: trunk, size: 15829)
2014-07-23
21:52
[03330004] part of check-in [378dad36] For the test-comment-format command, also treat the original comment text argument as a file name when the --file option is specified. Fix memory leaks when the --file and --decode options are used together. (check-in: [378dad36] user: mistachkin branch: trunk, size: 15199)
21:37
[c438ef4a] part of check-in [0d0b80fd] When available, pass the original comment text as well as the (possibly prefixed) comment into comment_print(). Add COMMENT_PRINT_ORIG_BREAK flag to the new comment printing algorithm. Change the width argument for the test-comment-format command into an option. Add --origbreak option to the test-comment-format command. (check-in: [0d0b80fd] user: mistachkin branch: trunk, size: 15004)
18:26
[4819fffb] part of check-in [b1b352e1] Add --file option to the test-comment-format test command. (check-in: [b1b352e1] user: mistachkin branch: trunk, size: 12789)
2014-07-20
05:09
[f3163ecf] part of check-in [68cd1f5b] Correct usage syntax error message for the 'test-comment-format' command. (check-in: [68cd1f5b] user: mistachkin branch: experimental, size: 12493)
04:24
[2e2a786b] part of check-in [4a5352c2] Enhance comments that describe the new comment printing function. (check-in: [4a5352c2] user: mistachkin branch: experimental, size: 12483)
02:35
[2961f129] part of check-in [18a97b3a] Add -comfmtflags command line option to set the comment printing flags, defaulting to the legacy comment printing algorithm. (check-in: [18a97b3a] user: mistachkin branch: experimental, size: 11067)
02:10
[8cbf7419] part of check-in [5ea6a95a] Merge updates from trunk. (check-in: [5ea6a95a] user: mistachkin branch: experimental, size: 11071)
2014-07-10
10:01
[7c0c3360] part of check-in [32205fdc] ./src/comformat.c: In function ‘comment_print’: ./src/comformat.c:70:5: warning: implicit declaration of function ‘ioctl’ [-Werror=implicit-function-declaration] if( ioctl(0, TIOCGWINSZ, &w)!=-1 ){ ^ (check-in: [32205fdc] user: jan.nijtmans branch: trunk, size: 4565)
2014-06-21
01:38
[e3a9141f] part of check-in [4e3f915c] Add --trimspace option to the 'test-comment-format' test command. (check-in: [4e3f915c] user: mistachkin branch: experimental, size: 11013)
01:32
[48158b11] part of check-in [0463c7bf] Re-add the legacy comment printing algorithm. Currently, it is being retained primarily for testing and comparison purposes. (check-in: [0463c7bf] user: mistachkin branch: experimental, size: 10867)
2014-06-20
19:15
[69604bb1] part of check-in [fc84a01a] Merge updates from trunk. (check-in: [fc84a01a] user: mistachkin branch: respectformatting, size: 4285)
19:11
[8af38bff] part of check-in [2920e7df] Add and adjust comment tests from the experimental branch. (check-in: [2920e7df] user: mistachkin branch: trunk, size: 4507)
18:56
[c8235b73] part of check-in [856d10ae] Reorganize the new code, making internal functions private. Add COMMENT_PRINT_TRIM_SPACE flag, on by default. (check-in: [856d10ae] user: mistachkin branch: experimental, size: 7932)
18:31
[f67f6c7b] part of check-in [70ba07c3] Further refinements and more tests. (check-in: [70ba07c3] user: mistachkin branch: experimental, size: 7560)
03:56
[71deb666] part of check-in [10b47cc3] Initial draft of the ability to break a multi-line comment on word boundaries using the new algorithm. (check-in: [10b47cc3] user: mistachkin branch: experimental, size: 7367)
2014-06-19
21:25
[c2ce9ab2] part of check-in [89aa595f] Complete re-write of the comment printing algorithm, taking the preservation of any pre-existing formatting within the comment into account. No attempt is made to avoid breaking a line in the middle of a word. (check-in: [89aa595f] user: mistachkin branch: experimental, size: 5738)
05:43
[3b4fe0fa] part of check-in [d5476292] Merge updates from branch. Gracefully handle the case where the first line contains no spaces. (check-in: [d5476292] user: mistachkin branch: experimental, size: 4477)
03:04
[31e911e2] part of check-in [05ea665f] Merge variable name change. (check-in: [05ea665f] user: mistachkin branch: experimental, size: 4283)
03:03
[0e8b6f01] part of check-in [b68446e2] Rename the zBuf variable to zLine, to improve clarity. (check-in: [b68446e2] user: mistachkin branch: respectformatting, size: 4180)
02:39
[12b03962] part of check-in [816faa5a] Experimental changes for more precise handling of new lines. (check-in: [816faa5a] user: mistachkin branch: experimental, size: 4274)
02:39
[131c930f] part of check-in [c7c3d99a] Even more style improvements. (check-in: [c7c3d99a] user: mistachkin branch: respectformatting, size: 4172)
01:32
[9237f26a] part of check-in [504b0ae0] Further code style improvements. (check-in: [504b0ae0] user: mistachkin branch: respectformatting, size: 4188)
01:20
[21b1905b] part of check-in [4b675fb0] Merge updates from trunk. (check-in: [4b675fb0] user: mistachkin branch: respectformatting, size: 4174)
01:19
[4fdfe494] part of check-in [8da0f344] Add 'decode' option to the 'test-comment-format' test command. (check-in: [8da0f344] user: mistachkin branch: trunk, size: 4402)
00:48
[5f650fc6] part of check-in [3221e519] Merge updates from trunk. (check-in: [3221e519] user: mistachkin branch: respectformatting, size: 3731)
00:47
[56c03298] part of check-in [6a3b39a0] Enhance the 'test-comment-format' test command. (check-in: [6a3b39a0] user: mistachkin branch: trunk, size: 3959)
2014-06-18
23:30
[33208642] part of check-in [41804ab1] Improve clarity of presentation via several stylistic changes. (check-in: [41804ab1] user: mistachkin branch: respectformatting, size: 3508)
15:07
[9fe836e4] part of check-in [10eea3ab] make fossil timeline to respect the log formatting aka multiline logs. Suggested by Baptiste Daroussin. (check-in: [10eea3ab] user: jan.nijtmans branch: respectformatting, size: 3542)
2014-06-17
22:15
[77af14c1] part of check-in [54cc57e7] On non-Windows systems that appear to lack the TIOCGWINSZ define, fallback to using the legacy behavior of hard-coding a reasonable default maximum line length. (check-in: [54cc57e7] user: mistachkin branch: trunk, size: 3736)
20:16
[d7394281] part of check-in [4c194957] Remove superfluous include and add a missing blank line. (check-in: [4c194957] user: mistachkin branch: autoadjust, size: 3199)
2014-06-16
21:02
[6dd42e5c] part of check-in [f4cab56c] Adjust width auto-detection on Windows for more reasonable line breaks when the final character is a '-'. Seen with comment for check-in [4514910a5f] and a console width of 233. (check-in: [f4cab56c] user: mistachkin branch: autoadjust, size: 3219)
20:28
[7d8e9e5f] part of check-in [9270ae24] Improvements to error handling and code formatting. (check-in: [9270ae24] user: mistachkin branch: autoadjust, size: 3223)
09:05
[300c75f1] part of check-in [40710b7a] Merge trunk. Make it work on Windows too. Variable width output on more commands. (check-in: [40710b7a] user: jan.nijtmans branch: autoadjust, size: 3092)
2014-03-14
13:57
[e3d45335] part of check-in [5cdc39dc] Enhance the "whatis" command to report on attachments and to include raw tags so that cluster artifacts are identified. Add the "test-whatis-all" command to run "whatis" on every artifact in the repository. (check-in: [5cdc39dc] user: drh branch: trunk, size: 2637)
2014-01-28
08:20
[ef14fd3e] part of check-in [45f35169] More removals of unnecessary end-of-line spaces. No change in code. (check-in: [45f35169] user: jan.nijtmans branch: trunk, size: 2602)
2013-10-29
10:55
[53bb36cd] part of check-in [2eb492e2] Add option -W|--width to the "fossil timeline" and "fossil finfo" commands. Defaults to 79. (check-in: [2eb492e2] user: jan.nijtmans branch: trunk, size: 2603)
2013-10-26
09:06
[92c6bd10] part of check-in [b2455507] Allow comment_print() to handle lines >400 characters. Add parameter "width" to print_timeline() function. (check-in: [b2455507] user: jan.nijtmans branch: trunk, size: 2646)
2013-10-25
12:42
[6fec4b4b] part of check-in [3710f2ac] Merge trunk. Add the "-W|--width WIDTH" option to "fossil timeline". Default is 80. (check-in: [3710f2ac] user: jan.nijtmans branch: timeline_cmd_dash_n_fix, size: 2547)
2012-08-29
13:57
[61d352f1] part of check-in [9f6abc59] Allow UTF-8 characters in sources. translate.exe will translate it to ASCII (check-in: [9f6abc59] user: jan.nijtmans branch: msvc-broken, size: 2515)
2012-03-29
14:54
[76c82b99] part of check-in [a496d8e8] Add vim modline everywhere (check-in: [a496d8e8] user: mgagnon branch: mgagnon_fix, size: 2558)
2011-04-27
18:21
[4c6ab377] part of check-in [e805fa8d] Attempt to get Fossil working on windows systems that do not use UTF8 in the shell. (check-in: [e805fa8d] user: drh branch: windows-i18n, size: 2516)
2010-10-14
19:14
[8591c01b] part of check-in [2fac8091] Remove all use of ctypes.h in order to avoid compiler warnings and other problems associated with changing locales. (check-in: [2fac8091] user: drh branch: trunk, size: 2480)
2010-05-16
19:08
[cb5f71dc] part of check-in [c06edd23] Change from GPL to the Simplified BSD License. (check-in: [c06edd23] user: drh branch: clear-title, size: 2459)
2007-07-21
14:10
[26c0414f] part of check-in [dbda8d6c] Initial check-in of m1 sources. (check-in: [dbda8d6c] user: drh branch: trunk, size: 2735) Added