git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] getcwd without PATH_MAX
@ 2014-07-20 16:46 René Scharfe
  2014-07-20 16:49 ` [PATCH v2 1/4] strbuf: add strbuf_getcwd() René Scharfe
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: René Scharfe @ 2014-07-20 16:46 UTC (permalink / raw)
  To: Git Mailing List
  Cc: Junio C Hamano, Karsten Blees,
	Nguyễn Thái Ngọc Duy

Paths longer than PATH_MAX can be created and used on at least on some
file systems.  Currently we use getcwd() generally with a PATH_MAX-
sized buffer.  This series adds two functions, strbuf_getcwd() and
xgetcwd(), then uses them to reduce the number of fixed-sized buffers
and to allow us to handle longer working directory paths.

Not all getcwd() calls are replaced, however.  I hope that at least
some of the remaining ones can be avoided altogether.  If that turns
out to be too optimistic then we can use the added function to convert
the rest.

Changes in v2:
  * strbuf_getcwd() instead of strbuf_add_cwd(), because the former is
    simpler and sufficient for now; based on a suggestion by Duy
  * added patch 2 as an example for strbuf_getcwd() usage, suggested
    by Duy
  * made sure strbuf_getcwd() leaves the strbuf intact, no matter
    what getcwd() does
  * converted an easy getcwd() call in setup.c

René Scharfe (4):
  strbuf: add strbuf_getcwd()
  use strbuf_getcwd() to get the current working directory without
    fixed-sized buffers
  wrapper: add xgetcwd()
  use xgetcwd() get the current directory or die

 Documentation/technical/api-strbuf.txt |  4 ++++
 builtin/init-db.c                      | 25 ++++++++++++-------------
 builtin/rev-parse.c                    |  6 +++---
 dir.c                                  | 12 ++++++++----
 git-compat-util.h                      |  1 +
 git.c                                  |  6 ++++--
 setup.c                                |  6 +++---
 strbuf.c                               | 21 +++++++++++++++++++++
 strbuf.h                               |  1 +
 trace.c                                |  7 ++++---
 wrapper.c                              |  8 ++++++++
 11 files changed, 69 insertions(+), 28 deletions(-)

-- 
2.0.2

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-22 10:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-20 16:46 [PATCH v2 0/4] getcwd without PATH_MAX René Scharfe
2014-07-20 16:49 ` [PATCH v2 1/4] strbuf: add strbuf_getcwd() René Scharfe
2014-07-20 16:49 ` [PATCH v2 2/4] use strbuf_getcwd() to get the current working directory without fixed-sized buffers René Scharfe
2014-07-21  2:33   ` Jeff King
2014-07-21 17:10     ` René Scharfe
2014-07-22 10:43       ` Jeff King
2014-07-21 19:02     ` Junio C Hamano
2014-07-20 16:50 ` [PATCH v2 3/4] wrapper: add xgetcwd() René Scharfe
2014-07-20 16:51 ` [PATCH v2 4/4] use xgetcwd() get the current directory or die René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).