column: add dense layout support

Normally all cells (and in turn columns) share the same width. This
layout mode can waste space because one long item can stretch our all
columns.

With COL_DENSE enabled, column width is calculated indepdendently. All
columns are shrunk to minimum, then it attempts to push cells of the
last row over to the next column with hope that everything still fits
even there's one row less. The process is repeated until the new layout
cannot fit in given width any more, or there's only one row left
(perfect!).

Apparently, this mode consumes more cpu than the old one, but it makes
better use of terminal space. For layouting one or two screens, cpu
usage should not be detectable.

This patch introduces option handling code besides layout modes and
enable/disable to expose this feature as "dense". The feature can be
turned off by specifying "nodense".

Thanks-to: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 files changed
tree: 05ed415a20f13d1c71b45e5e8ce876b98d6774c1
  1. block-sha1/
  2. builtin/
  3. compat/
  4. contrib/
  5. Documentation/
  6. git-gui/
  7. git_remote_helpers/
  8. gitk-git/
  9. gitweb/
  10. mergetools/
  11. perl/
  12. po/
  13. ppc/
  14. t/
  15. templates/
  16. vcs-svn/
  17. xdiff/
  18. .gitattributes
  19. .gitignore
  20. .mailmap
  21. abspath.c
  22. aclocal.m4
  23. advice.c
  24. advice.h
  25. alias.c
  26. alloc.c
  27. archive-tar.c
  28. archive-zip.c
  29. archive.c
  30. archive.h
  31. argv-array.c
  32. argv-array.h
  33. attr.c
  34. attr.h
  35. base85.c
  36. bisect.c
  37. bisect.h
  38. blob.c
  39. blob.h
  40. branch.c
  41. branch.h
  42. builtin.h
  43. bulk-checkin.c
  44. bulk-checkin.h
  45. bundle.c
  46. bundle.h
  47. cache-tree.c
  48. cache-tree.h
  49. cache.h
  50. check-builtins.sh
  51. check-racy.c
  52. check_bindir
  53. color.c
  54. color.h
  55. column.c
  56. column.h
  57. combine-diff.c
  58. command-list.txt
  59. commit.c
  60. commit.h
  61. config.c
  62. config.mak.in
  63. configure.ac
  64. connect.c
  65. connected.c
  66. connected.h
  67. convert.c
  68. convert.h
  69. copy.c
  70. COPYING
  71. credential-cache--daemon.c
  72. credential-cache.c
  73. credential-store.c
  74. credential.c
  75. credential.h
  76. csum-file.c
  77. csum-file.h
  78. ctype.c
  79. daemon.c
  80. date.c
  81. decorate.c
  82. decorate.h
  83. delta.h
  84. diff-delta.c
  85. diff-lib.c
  86. diff-no-index.c
  87. diff.c
  88. diff.h
  89. diffcore-break.c
  90. diffcore-delta.c
  91. diffcore-order.c
  92. diffcore-pickaxe.c
  93. diffcore-rename.c
  94. diffcore.h
  95. dir.c
  96. dir.h
  97. editor.c
  98. entry.c
  99. environment.c
  100. exec_cmd.c
  101. exec_cmd.h
  102. fast-import.c
  103. fetch-pack.h
  104. fixup-builtins
  105. fmt-merge-msg.h
  106. fsck.c
  107. fsck.h
  108. generate-cmdlist.sh
  109. gettext.c
  110. gettext.h
  111. git-add--interactive.perl
  112. git-am.sh
  113. git-archimport.perl
  114. git-bisect.sh
  115. git-compat-util.h
  116. git-cvsexportcommit.perl
  117. git-cvsimport.perl
  118. git-cvsserver.perl
  119. git-difftool--helper.sh
  120. git-difftool.perl
  121. git-filter-branch.sh
  122. git-instaweb.sh
  123. git-lost-found.sh
  124. git-merge-octopus.sh
  125. git-merge-one-file.sh
  126. git-merge-resolve.sh
  127. git-mergetool--lib.sh
  128. git-mergetool.sh
  129. git-parse-remote.sh
  130. git-pull.sh
  131. git-quiltimport.sh
  132. git-rebase--am.sh
  133. git-rebase--interactive.sh
  134. git-rebase--merge.sh
  135. git-rebase.sh
  136. git-relink.perl
  137. git-remote-testgit.py
  138. git-repack.sh
  139. git-request-pull.sh
  140. git-send-email.perl
  141. git-sh-i18n.sh
  142. git-sh-setup.sh
  143. git-stash.sh
  144. git-submodule.sh
  145. git-svn.perl
  146. GIT-VERSION-GEN
  147. git-web--browse.sh
  148. git.c
  149. git.spec.in
  150. gpg-interface.c
  151. gpg-interface.h
  152. graph.c
  153. graph.h
  154. grep.c
  155. grep.h
  156. hash.c
  157. hash.h
  158. help.c
  159. help.h
  160. hex.c
  161. http-backend.c
  162. http-fetch.c
  163. http-push.c
  164. http-walker.c
  165. http.c
  166. http.h
  167. ident.c
  168. imap-send.c
  169. INSTALL
  170. kwset.c
  171. kwset.h
  172. levenshtein.c
  173. levenshtein.h
  174. LGPL-2.1
  175. list-objects.c
  176. list-objects.h
  177. ll-merge.c
  178. ll-merge.h
  179. lockfile.c
  180. log-tree.c
  181. log-tree.h
  182. mailmap.c
  183. mailmap.h
  184. Makefile
  185. match-trees.c
  186. merge-file.c
  187. merge-file.h
  188. merge-recursive.c
  189. merge-recursive.h
  190. name-hash.c
  191. notes-cache.c
  192. notes-cache.h
  193. notes-merge.c
  194. notes-merge.h
  195. notes.c
  196. notes.h
  197. object.c
  198. object.h
  199. pack-check.c
  200. pack-refs.c
  201. pack-refs.h
  202. pack-revindex.c
  203. pack-revindex.h
  204. pack-write.c
  205. pack.h
  206. pager.c
  207. parse-options-cb.c
  208. parse-options.c
  209. parse-options.h
  210. patch-delta.c
  211. patch-ids.c
  212. patch-ids.h
  213. path.c
  214. pkt-line.c
  215. pkt-line.h
  216. preload-index.c
  217. pretty.c
  218. progress.c
  219. progress.h
  220. prompt.c
  221. prompt.h
  222. quote.c
  223. quote.h
  224. reachable.c
  225. reachable.h
  226. read-cache.c
  227. README
  228. reflog-walk.c
  229. reflog-walk.h
  230. refs.c
  231. refs.h
  232. remote-curl.c
  233. remote.c
  234. remote.h
  235. replace_object.c
  236. rerere.c
  237. rerere.h
  238. resolve-undo.c
  239. resolve-undo.h
  240. revision.c
  241. revision.h
  242. run-command.c
  243. run-command.h
  244. send-pack.h
  245. sequencer.c
  246. sequencer.h
  247. server-info.c
  248. setup.c
  249. sh-i18n--envsubst.c
  250. sha1-array.c
  251. sha1-array.h
  252. sha1-lookup.c
  253. sha1-lookup.h
  254. sha1_file.c
  255. sha1_name.c
  256. shallow.c
  257. shell.c
  258. shortlog.h
  259. show-index.c
  260. sideband.c
  261. sideband.h
  262. sigchain.c
  263. sigchain.h
  264. strbuf.c
  265. strbuf.h
  266. streaming.c
  267. streaming.h
  268. string-list.c
  269. string-list.h
  270. submodule.c
  271. submodule.h
  272. symlinks.c
  273. tag.c
  274. tag.h
  275. tar.h
  276. test-chmtime.c
  277. test-credential.c
  278. test-ctype.c
  279. test-date.c
  280. test-delta.c
  281. test-dump-cache-tree.c
  282. test-genrandom.c
  283. test-index-version.c
  284. test-line-buffer.c
  285. test-match-trees.c
  286. test-mktemp.c
  287. test-parse-options.c
  288. test-path-utils.c
  289. test-run-command.c
  290. test-scrap-cache-tree.c
  291. test-sha1.c
  292. test-sha1.sh
  293. test-sigchain.c
  294. test-subprocess.c
  295. test-svn-fe.c
  296. thread-utils.c
  297. thread-utils.h
  298. trace.c
  299. transport-helper.c
  300. transport.c
  301. transport.h
  302. tree-diff.c
  303. tree-walk.c
  304. tree-walk.h
  305. tree.c
  306. tree.h
  307. unimplemented.sh
  308. unix-socket.c
  309. unix-socket.h
  310. unpack-trees.c
  311. unpack-trees.h
  312. upload-pack.c
  313. url.c
  314. url.h
  315. usage.c
  316. userdiff.c
  317. userdiff.h
  318. utf8.c
  319. utf8.h
  320. walker.c
  321. walker.h
  322. wrap-for-bin.sh
  323. wrapper.c
  324. write_or_die.c
  325. ws.c
  326. wt-status.c
  327. wt-status.h
  328. xdiff-interface.c
  329. xdiff-interface.h
  330. zlib.c