aboutsummaryrefslogtreecommitdiff
path: root/Documentation/technical/api-strbuf.txt
Commit message (Collapse)AuthorAge
* Merge branch 'rs/export-strbuf-addchars'Junio C Hamano2014-09-19
|\ | | | | | | | | | | | | | | Code clean-up. * rs/export-strbuf-addchars: strbuf: use strbuf_addchars() for adding a char multiple times strbuf: export strbuf_addchars()
| * strbuf: export strbuf_addchars()René Scharfe2014-09-08
| | | | | | | | | | | | | | | | Move strbuf_addchars() to strbuf.c, where it belongs, and make it available for other callers. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/strbuf-getcwd'Junio C Hamano2014-09-02
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the use of fixed sized buffer passed to getcwd() calls by introducing xgetcwd() helper. * rs/strbuf-getcwd: use strbuf_add_absolute_path() to add absolute paths abspath: convert absolute_path() to strbuf use xgetcwd() to set $GIT_DIR use xgetcwd() to get the current directory or die wrapper: add xgetcwd() abspath: convert real_path_internal() to strbuf abspath: use strbuf_getcwd() to remember original working directory setup: convert setup_git_directory_gently_1 et al. to strbuf unix-sockets: use strbuf_getcwd() strbuf: add strbuf_getcwd()
| * | abspath: convert absolute_path() to strbufRené Scharfe2014-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move most of the code of absolute_path() into the new function strbuf_add_absolute_path() and in the process transform it to use struct strbuf and xgetcwd() instead of a PATH_MAX-sized buffer, which can be too small on some file systems. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | strbuf: add strbuf_getcwd()René Scharfe2014-07-28
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Add strbuf_getcwd(), which puts the current working directory into a strbuf. Because it doesn't use a fixed-size buffer it supports arbitrarily long paths, provided the platform's getcwd() does as well. At least on Linux and FreeBSD it handles paths longer than PATH_MAX just fine. Suggested-by: Karsten Blees <karsten.blees@gmail.com> Helped-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jm/api-strbuf-doc'Junio C Hamano2014-06-20
|\ \ | | | | | | | | | | | | * jm/api-strbuf-doc: api-strbuf.txt minor typos
| * | api-strbuf.txt minor typosJeremiah Mahler2014-06-09
| |/ | | | | | | | | | | | | | | Fixed some minor typos in api-strbuf.txt: 'A' instead of 'An', 'have' instead of 'has', a overlong line, and 'another' instead of 'an other'. Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/http-errors'Junio C Hamano2014-06-16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Propagate the error messages from the webserver better to the client coming over the HTTP transport. * jk/http-errors: http: default text charset to iso-8859-1 remote-curl: reencode http error messages strbuf: add strbuf_reencode helper http: optionally extract charset parameter from content-type http: extract type/subtype portion of content-type t5550: test display of remote http error messages t/lib-httpd: use write_script to copy CGI scripts test-lib: preserve GIT_CURL_VERBOSE from the environment
| * | strbuf: add strbuf_reencode helperJeff King2014-05-27
| |/ | | | | | | | | | | | | | | This is a convenience wrapper around `reencode_string_len` and `strbuf_attach`. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/strbuf-tolower'Junio C Hamano2014-06-16
|\ \ | | | | | | | | | | | | * jk/strbuf-tolower: strbuf: add strbuf_tolower function
| * | strbuf: add strbuf_tolower functionJeff King2014-05-23
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a convenience wrapper to call tolower on each character of the string. This makes config's lowercase() function obsolete, though note that because we have a strbuf, we are careful to operate over the whole strbuf, rather than assuming that a NUL is the end-of-string. We could continue to offer a pure-string lowercase, but there would be no callers (in most pure-string cases, we actually duplicate and lowercase the duplicate, for which we have the xstrdup_tolower wrapper). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | api-strbuf.txt: add docs for _trim and _ltrimBrian Gesiak2014-05-06
|/ | | | | | | | | API documentation for strbuf does not document strbuf_trim() or strbuf_ltrim(). Add documentation for these two functions. Signed-off-by: Brian Gesiak <modocache@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: create strbuf_humanise_bytes() to show byte sizesAntoine Pelisse2013-04-10
| | | | | | | | | | | | | | | | | Humanization of downloaded size is done in the same function as text formatting in 'process.c'. The code cannot be reused easily elsewhere. Separate text formatting from size simplification and make the function public in strbuf so that it can easily be used by other callers. We now can use strbuf_humanise_bytes() for both downloaded size and download speed calculation. One of the drawbacks is that speed will now look like this when download is stalled: "0 bytes/s" instead of "0 KiB/s". Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Allow custom "comment char"Junio C Hamano2013-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users do want to write a line that begin with a pound sign, #, in their commit log message. Many tracking system recognise a token of #<bugid> form, for example. The support we offer these use cases is not very friendly to the end users. They have a choice between - Don't do it. Avoid such a line by rewrapping or indenting; and - Use --cleanup=whitespace but remove all the hint lines we add. Give them a way to set a custom comment char, e.g. $ git -c core.commentchar="%" commit so that they do not have to do either of the two workarounds. [jc: although I started the topic, all the tests and documentation updates, many of the call sites of the new strbuf_add_commented_*() functions, and the change to git-submodule.sh scripted Porcelain are from Ralf.] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf_split*(): document functionsMichael Haggerty2012-11-04
| | | | | | | | | | Document strbuf_split_buf(), strbuf_split_str(), strbuf_split_max(), strbuf_split(), and strbuf_list_free() in the header file and in api-strbuf.txt. (These functions were previously completely undocumented.) Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net>
* strbuf: improve strbuf_get*line documentationThomas Rast2012-02-23
| | | | | | | | Clarify strbuf_getline() documentation, and add the missing documentation for strbuf_getwholeline() and strbuf_getwholeline_fd(). Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: add strbuf_addbuf_percentquoteJeff King2010-01-14
| | | | | | | | This is handy for creating strings which will be fed to printf() or strbuf_expand(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf_expand: convert "%%" to "%"Jeff King2010-01-14
| | | | | | | | | | | | | | | | | | | | | | | The only way to safely quote arbitrary text in a pretty-print user format is to replace instances of "%" with "%x25". This is slightly unreadable, and many users would expect "%%" to produce a single "%", as that is what printf format specifiers do. This patch converts "%%" to "%" for all users of strbuf_expand(): (1) git-daemon interpolated paths (2) pretty-print user formats (3) merge driver command lines Case (1) was already doing the conversion itself outside of strbuf_expand(). Case (2) is the intended beneficiary of this patch. Case (3) users probably won't notice, but as this is user-facing behavior, consistently providing the quoting mechanism makes sense. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* api-strbuf.txt: fix typos and document launch_editor()Stephen Boyd2009-12-17
| | | | | Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: Typo / spelling / formatting fixesMike Ralphson2009-03-03
| | | | | Signed-off-by: Mike Ralphson <mike@abacus.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2009-02-04
|\ | | | | | | | | | | | | | | | | | | | | * maint: User-manual: "git stash <comment>" form is long gone add test-dump-cache-tree in Makefile fix typo in Documentation apply: fix access to an uninitialized mode variable, found by valgrind Conflicts: Makefile
| * Merge branch 'maint-1.6.0' into maintJunio C Hamano2009-02-03
| |\ | | | | | | | | | | | | | | | | | | | | | * maint-1.6.0: User-manual: "git stash <comment>" form is long gone add test-dump-cache-tree in Makefile fix typo in Documentation apply: fix access to an uninitialized mode variable, found by valgrind
| | * fix typo in DocumentationGuanqun Lu2009-02-03
| | | | | | | | | | | | | | | Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | strbuf: instate cleanup rule in case of non-memory errorsRené Scharfe2009-01-06
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make all strbuf functions that can fail free() their memory on error if they have allocated it. They don't shrink buffers that have been grown, though. This allows for easier error handling, as callers only need to call strbuf_release() if A) the command succeeded or B) if they would have had to do so anyway because they added something to the strbuf themselves. Bonus hunk: document strbuf_readlink. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | add strbuf_expand_dict_cb(), a helper for simple casesRené Scharfe2008-11-23
|/ | | | | | | | | | | | | | | The new callback function strbuf_expand_dict_cb() can be used together with strbuf_expand() if there is only a small number of placeholders for static replacement texts. It expects its dictionary as an array of placeholder+value pairs as context parameter, terminated by an entry with the placeholder member set to NULL. The new helper is intended to aid converting the remaining calls of interpolate(). strbuf_expand() is smaller, more flexible and can be used to go faster than interpolate(), so it should replace the latter. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Strbuf documentation: document most functionsMiklos Vajna2008-06-04
| | | | | | | All functions in strbuf.h are documented, except launch_editor(). Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Start preparing the API documents.Junio C Hamano2007-12-14
Most of them are still stubs, but the procedure to build the HTML documentation, maintaining the index and installing the end product are there. I placed names of people who are likely to know the most about the topic in the stub files, so that volunteers will know whom to ask questions as needed. Signed-off-by: Junio C Hamano <gitster@pobox.com>