git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* [PATCH 0/6] prefix_filename cleanups
@ 2017-03-21  1:18 Jeff King
  2017-03-21 17:53 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff King @ 2017-03-21  1:18 UTC (permalink / raw)
  To: git

I noticed a spot in builtin/bundle.c that would benefit from using
prefix_filename(). But when I tried to use it, I noticed its interface
was a little error-prone (because it returns a static buffer). And
indeed, a little digging found a bug in hash-object related to this.

So here's the fix for the hash-object bug, some cleanups to make such
bugs less likely, and then finally the bundle conversion. The bundle
thing does fix some minor bugs. It _could_ come before the cleanups if
we wanted to float the fixes to the top, but the function is much more
pleasant to call after the cleanups. :)

  [1/6]: hash-object: fix buffer reuse with --path in a subdirectory
  [2/6]: prefix_filename: move docstring to header file
  [3/6]: prefix_filename: drop length parameter
  [4/6]: prefix_filename: return newly allocated string
  [5/6]: prefix_filename: simplify windows #ifdef
  [6/6]: bundle: use prefix_filename with bundle path

 abspath.c              | 30 +++++++++++-------------------
 apply.c                | 11 ++++++-----
 builtin/bundle.c       |  8 +-------
 builtin/config.c       |  4 +---
 builtin/hash-object.c  | 10 +++++-----
 builtin/log.c          |  3 +--
 builtin/mailinfo.c     | 11 ++---------
 builtin/merge-file.c   | 18 +++++++++++-------
 builtin/rev-parse.c    |  6 +++---
 builtin/worktree.c     |  5 +++--
 cache.h                | 14 +++++++++++++-
 diff-no-index.c        |  7 +++----
 diff.c                 |  6 +++---
 parse-options.c        |  2 +-
 setup.c                | 11 ++++++++---
 t/t1007-hash-object.sh | 10 ++++++++++
 worktree.c             |  5 ++++-
 17 files changed, 86 insertions(+), 75 deletions(-)

-Peff

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

* Re: [PATCH 0/6] prefix_filename cleanups
  2017-03-21  1:18 [PATCH 0/6] prefix_filename cleanups Jeff King
@ 2017-03-21 17:53 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2017-03-21 17:53 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King <peff@peff.net> writes:

> I noticed a spot in builtin/bundle.c that would benefit from using
> prefix_filename(). But when I tried to use it, I noticed its interface
> was a little error-prone (because it returns a static buffer). And
> indeed, a little digging found a bug in hash-object related to this.
>
> So here's the fix for the hash-object bug, some cleanups to make such
> bugs less likely, and then finally the bundle conversion. The bundle
> thing does fix some minor bugs. It _could_ come before the cleanups if
> we wanted to float the fixes to the top, but the function is much more
> pleasant to call after the cleanups. :)

Thanks.  They all looked sensible.

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21  1:18 [PATCH 0/6] prefix_filename cleanups Jeff King
2017-03-21 17:53 ` Junio C Hamano

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox