summaryrefslogtreecommitdiff
path: root/Documentation/git-commit-tree.txt
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-05-21 23:10:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-22 16:08:20 (GMT)
commit8587ead78ad3d2af760270b21035ffe48fde3e7b (patch)
tree07ea7935298964245e4430b14d674a59eb1c9aac /Documentation/git-commit-tree.txt
parent060d4bb3d6c0f4ca3b85f089708b07447224bc91 (diff)
downloadgit-8587ead78ad3d2af760270b21035ffe48fde3e7b.zip
git-8587ead78ad3d2af760270b21035ffe48fde3e7b.tar.gz
git-8587ead78ad3d2af760270b21035ffe48fde3e7b.tar.bz2
drop length limitations on gecos-derived names and emails
When we pull the user's name from the GECOS field of the passwd file (or generate an email address based on their username and hostname), we put the result into a static buffer. While it's extremely unlikely that anybody ever hit these limits (after all, in such a case their parents must have hated them), we still had to deal with the error cases in our code. Converting these static buffers to strbufs lets us simplify the code and drop some error messages from the documentation that have confused some users. The conversion is mostly mechanical: replace string copies with strbuf equivalents, and access the strbuf.buf directly. There are a few exceptions: - copy_gecos and copy_email are the big winners in code reduction (since they no longer have to manage the string length manually) - git_ident_config wants to replace old versions of the default name (e.g., if we read the config multiple times), so it must reset+add to the strbuf instead of just adding Note that there is still one length limitation: the gethostname interface requires us to provide a static buffer, so we arbitrarily choose 1024 bytes for the hostname. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-commit-tree.txt')
-rw-r--r--Documentation/git-commit-tree.txt4
1 files changed, 0 insertions, 4 deletions
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index cfb9906..eb12b2d 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -92,10 +92,6 @@ Diagnostics
-----------
You don't exist. Go away!::
The passwd(5) gecos field couldn't be read
-Your parents must have hated you!::
- The passwd(5) gecos field is longer than a giant static buffer.
-Your sysadmin must hate you!::
- The passwd(5) name field is longer than a giant static buffer.
Discussion
----------