git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/6] removing more calls to git_path()

From
Jeff King <peff@peff.net>
Date
Apr 20, 2017, 21:07 UTC
Message-ID
<20170420210754.bzrnc74dpjs7fgpf@sigill.intra.peff.net>
After the discussion about the git_path()-related bug in:
  http://public-inbox.org/git/20170329080820.8084-1-chriscool@tuxfamily.org/

I looked over some of the calls. When I introduced git_pathdup() a few years ago I converted most of the dangerous git_path() calls. But there were still some left, and of course new ones have been added. This patch cleans up some of the low-hanging fruit.

There's probably more that could be done, but this is just what I happened to produce when looking through some of the cases the other day. I don't think any of these is fixing a triggerable bug; they can all be considered cleanup.

  [1/6]: bisect: add git_path_bisect_terms helper
  [2/6]: branch: add edit_description() helper
  [3/6]: use git_path_* helper functions
  [4/6]: replace xstrdup(git_path(...)) with git_pathdup(...)
  [5/6]: replace strbuf_addstr(git_path()) with git_path_buf()
  [6/6]: am: drop "dir" parameter from am_state_init
 bisect.c           |  3 ++-
 builtin/am.c       | 10 ++++------
 builtin/branch.c   |  6 +++---
 builtin/commit.c   |  6 +++---
 builtin/config.c   |  5 +++--
 builtin/pull.c     |  4 ++--
 builtin/worktree.c |  6 ++----
 fast-import.c      |  2 +-
 notes-merge.c      |  4 ++--
 sequencer.c        | 12 ++++++------
 10 files changed, 28 insertions(+), 30 deletions(-)
Next: Jeff King
Message 1 of 8 in “removing more calls to git_path()”
  1. 0/6 removing more calls to git_path()Jeff King, Apr 20, 2017
  2. 1/6 bisect: add git_path_bisect_terms helperJeff King, Apr 20, 2017
  3. 2/6 branch: add edit_description() helperJeff King, Apr 20, 2017
  4. 3/6 use git_path_* helper functionsJeff King, Apr 20, 2017
  5. 4/6 replace xstrdup(git_path(...)) with git_pathdup(...)Jeff King, Apr 20, 2017
  6. 5/6 replace strbuf_addstr(git_path()) with git_path_buf()Jeff King, Apr 20, 2017
  7. 6/6 am: drop "dir" parameter from am_state_initJeff King, Apr 20, 2017
  8. Junio C HamanoApr 21, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.