itory.
* always pass --threads=%d in order to limit threads to child proccess.
Brandon Williams (6):
submodules: add helper functions to determine presence of submodules
submodules: load gitmodules file from commit sha1
grep: add submodules as a grep source type
grep: optionally recurse
teach submodules to load a '.gitmodules' file from a commit sha1. This
enables the population of the submodule_cache to be based on the state
of the '.gitmodules' file from a particular commit.
Signed-off-by: Brandon Williams
---
cache.h| 2 ++
con
he searching of history from a submodule's gitdir, rather
than from a working directory.
Signed-off-by: Brandon Williams
---
builtin/grep.c | 20 +--
t/t7814-grep-recurse-submodules.sh | 41 ++
2 files changed, 59 insertio
he command
`git grep -e. -l --recurse-submodules HEAD`
from:
HEAD:file
:sub/file
to:
HEAD:file
HEAD:sub/file
Signed-off-by: Brandon Williams
---
Documentation/git-grep.txt | 13 +-
builtin/grep.c | 83 +++---
t/t7814-gr
submodule to be grep'd). If the
identifier is a SHA1 then we want to fall through to the
`GREP_SOURCE_SHA1` case to handle the copying of the SHA1.
Signed-off-by: Brandon Williams
---
grep.c | 16 +++-
grep.h | 1 +
2 files changed, 16 insertions(+), 1 deletion(-)
diff --
ff-by: Brandon Williams
---
Documentation/git-grep.txt | 5 +
builtin/grep.c | 300 ++---
git.c | 2 +-
t/t7814-grep-recurse-submodules.sh | 99
4 files changed, 385 insertions(+), 21 dele
On 11/18, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > @@ -671,12 +707,29 @@ static int grep_tree(struct grep_opt *opt, const
> > struct pathspec *pathspec,
> > enum interesting match = entry_not_interesting;
> > struct name_entry entry;
>
On 11/18, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > diff --git a/grep.h b/grep.h
> > index 5856a23..267534c 100644
> > --- a/grep.h
> > +++ b/grep.h
> > @@ -161,6 +161,7 @@ struct grep_source {
> > GREP_SOU
On 11/18, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > +static int grep_cache(struct grep_opt *opt, const struct pathspec
> > *pathspec,
> > + int cached)
> > {
> > int hit = 0;
> > int nr;
> > + struct strb
On 11/18, Brandon Williams wrote:
> Also, in order to use the tree_entry_interesting code it looks like I'll
> either have to pipe through a flag saying 'yes i want to match against
> submodules' like I did for the other pathspec codepath. Either that or
> a
entry' '
> + git init sub2 &&
> + test_commit -C sub2 first &&
> + git add sub2 &&
> + git commit -m superproject
> +'
> +
> +test_expect_success 'intern the git dir fails for incomplete submodules' '
> + test_must_fail git submodule interngitdirs &&
> + # check that we did not break the repository:
> + git status
> +'
> +
> +test_done
> +
Could we add a test which has nested submodules that need to be
migrated? Hopfully its just as easy as adding the test :)
--
Brandon Williams
ule (e.g. consolidated values from local
> git
> configuration and the .gitmodules file in the worktree).
>
> For an example usage see test-submodule-config.c.
> --
> 2.11.0.rc2.18.g0126045.dirty
>
--
Brandon Williams
parameter.commit_sha1 = commit_sha1;
> + // todo: get the actual tree here:
s/todo/TODO
Makes it more clear that this is a TODO
--
Brandon Williams
On 11/21, Stefan Beller wrote:
> On Mon, Nov 21, 2016 at 4:11 PM, Brandon Williams wrote:
> > On 11/21, Stefan Beller wrote:
> >>
> >> switch (lookup_type) {
> >> @@ -448,7 +448,8 @@ static const struct submodule *config_from(struct
> >> submod
On 11/22, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > On 11/17, Stefan Beller wrote:
> >> On Thu, Nov 17, 2016 at 10:46 AM, Brandon Williams
> >> wrote:
> >>
> >> > sha1_array_clear(&commits)
local git
> > configuration and the .gitmodules file in the worktree).
> >
> > For an example usage see test-submodule-config.c.
I brought this up in v2, he must have just missed it for v3.
--
Brandon Williams
Add two helper functions to submodules.c.
`is_submodule_initialized()` checks if a submodule has been initialized
at a given path and `is_submodule_populated()` check if a submodule
has been checked out at a given path.
Signed-off-by: Brandon Williams
---
submodule.c | 38
teach submodules to load a '.gitmodules' file from a commit sha1. This
enables the population of the submodule_cache to be based on the state
of the '.gitmodules' file from a particular commit.
Signed-off-by: Brandon Williams
---
cache.h| 2 ++
con
submodule to be grep'd). If the
identifier is a SHA1 then we want to fall through to the
`GREP_SOURCE_SHA1` case to handle the copying of the SHA1.
Signed-off-by: Brandon Williams
---
grep.c | 16 +++-
grep.h | 1 +
2 files changed, 16 insertions(+), 1 deletion(-)
diff --
Major change in v5 is to use tree_is_interesting api instead of the vanilla
pathspec code for submodules. This is to fix the issue in the last seires
where I mix the two types. More tests were also added to ensure that the
changes to the pathspec code functioned properly.
Brandon Williams (6
he command
`git grep -e. -l --recurse-submodules HEAD`
from:
HEAD:file
:sub/file
to:
HEAD:file
HEAD:sub/file
Signed-off-by: Brandon Williams
---
Documentation/git-grep.txt | 13 -
builtin/grep.c | 76 ---
t/t7814-grep-recurse-sub
ff-by: Brandon Williams
---
Documentation/git-grep.txt | 5 +
builtin/grep.c | 300 ++---
git.c | 2 +-
t/t7814-grep-recurse-submodules.sh | 99
4 files changed, 386 insertions(+), 20 dele
he searching of history from a submodule's gitdir, rather
than from a working directory.
Signed-off-by: Brandon Williams
---
builtin/grep.c | 20 +--
t/t7814-grep-recurse-submodules.sh | 41 ++
2 files changed, 59 insertio
Series looks good to me. At least the issues I raised are fixed.
--
Brandon Williams
On 11/22, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > diff --git a/tree-walk.c b/tree-walk.c
> > index 828f435..ff77605 100644
> > --- a/tree-walk.c
> > +++ b/tree-walk.c
> > @@ -1004,6 +1004,19 @@ static enum interesting do_match
On 11/22, Brandon Williams wrote:
> On 11/22, Junio C Hamano wrote:
> > Brandon Williams writes:
> >
> > > diff --git a/tree-walk.c b/tree-walk.c
> > > index 828f435..ff77605 100644
> > > --- a/tree-walk.c
> > > +++ b/tree-walk.c
> >
On 11/22, Junio C Hamano wrote:
> Brandon Williams writes:
>
> >> > So this change may have an impact on "git ls-tree -r" with pathspec;
> >> > I offhand do not know if that impact is undesirable or not. A test
> >> > or two may be in
if (!pathspec->items[i].attr_match_nr)
> + continue;
> + for (j = 0; j < pathspec->items[j].attr_match_nr; j++)
This looks like a bug. Should it be:
for (j = 0; j < pathspec->items[i].attr_match_nr; j++)
where items[j] -> items[i]
--
Brandon Williams
> + die(_("Only one 'attr:' specification is allowed."));
> +
> + argv_array_clear(&attrs);
> + string_list_clear(&list, 0);
> + return;
> +}
Unnecessary return statement, maybe you want to remove it?
--
Brandon Williams
want to add logic like this to the 'copy_pathspec' function
so that when a pathspec struct is copied, the destination also has
ownership of its own attribute items.
--
Brandon Williams
n particular are you seeing issues with? I can't see any
issues running it locally.
--
Brandon Williams
> -Peff
With you're stress script I'm able to see the failures. The interesting
thing is that the entry missing is always from the non-submodule file.
--
Brandon Williams
On 11/30, Brandon Williams wrote:
> On 11/29, Jeff King wrote:
> > On Tue, Nov 29, 2016 at 01:37:59AM -0500, Jeff King wrote:
> >
> > > 2. Grep threads doing more complicated stuff that needs to take a
> > > lock. You might try building with -fsanitize=thr
On 11/30, Jeff King wrote:
> On Wed, Nov 30, 2016 at 06:32:04PM -0500, Jeff King wrote:
>
> > On Wed, Nov 30, 2016 at 03:28:23PM -0800, Brandon Williams wrote:
> >
> > > So I couldn't find a race condition in the code. I tracked the problem
> > > to gr
On 11/30, Jeff King wrote:
> On Wed, Nov 30, 2016 at 03:42:48PM -0800, Brandon Williams wrote:
>
> > > where 20813 and 20867 are two threads of the main process. One is doing
> > > the lstat and the other calls chdir at the same moment.
> >
> > Yeah so it l
t be workable manually. I think the chdir was
> in the main thread.
>
> -Peff
Yeah maybe we're missing something else...
How did you run strace with your stress script?
--
Brandon Williams
r/writer type of lock where many
> "reader" threads can take the "I need to lstat()" lock simultaneously,
> but block when an "I'm going to chdir()" writer holds it.
>
> -Peff
Oh interesting, I wonder if there is a way to not have to perform a
chdir since taking a lock to lstat wouldn't be ideal.
Thanks for helping out with this!
--
Brandon Williams
n error with the
submodule's .git file/directory then the child process will fail out.
--
Brandon Williams
Add two helper functions to submodules.c.
`is_submodule_initialized()` checks if a submodule has been initialized
at a given path and `is_submodule_populated()` check if a submodule
has been checked out at a given path.
Signed-off-by: Brandon Williams
---
submodule.c | 39
hreads trying to load thier files into a buffer in
memory.
Thanks to Stefan and Jeff for help debugging this problem.
Brandon Williams (6):
submodules: add helper functions to determine presence of submodules
submodules: load gitmodules file from commit sha1
grep: add submodules as
teach submodules to load a '.gitmodules' file from a commit sha1. This
enables the population of the submodule_cache to be based on the state
of the '.gitmodules' file from a particular commit.
Signed-off-by: Brandon Williams
---
cache.h| 2 ++
con
he command
`git grep -e. -l --recurse-submodules HEAD`
from:
HEAD:file
:sub/file
to:
HEAD:file
HEAD:sub/file
Signed-off-by: Brandon Williams
---
Documentation/git-grep.txt | 13 -
builtin/grep.c | 76 ---
t/t7814-grep-recurse-sub
ff-by: Brandon Williams
---
Documentation/git-grep.txt | 5 +
builtin/grep.c | 300 ++---
git.c | 2 +-
t/t7814-grep-recurse-submodules.sh | 99
4 files changed, 386 insertions(+), 20 dele
he searching of history from a submodule's gitdir, rather
than from a working directory.
Signed-off-by: Brandon Williams
---
builtin/grep.c | 20 +--
t/t7814-grep-recurse-submodules.sh | 41 ++
2 files changed, 59 insertio
submodule to be grep'd). If the
identifier is a SHA1 then we want to fall through to the
`GREP_SOURCE_SHA1` case to handle the copying of the SHA1.
Signed-off-by: Brandon Williams
---
grep.c | 16 +++-
grep.h | 1 +
2 files changed, 16 insertions(+), 1 deletion(-)
diff --
On 11/30, Jeff King wrote:
> On Wed, Nov 30, 2016 at 05:28:28PM -0800, Brandon Williams wrote:
>
> > v6 fixes a race condition which existed in the 'is_submodule_populated'
> > function. Instead of calling 'resolve_gitdir' to check for the existance
>
On 12/01, Johannes Sixt wrote:
> Am 01.12.2016 um 02:28 schrieb Brandon Williams:
> >+git init "su:b" &&
>
> Don't do that. Colons in file names won't work on Windows.
>
> -- Hannes
>
This test is needed to see if the code still works wi
est we bump
> the minimum curl version there; there's a ton of #ifdef cruft going
> back to 2002-era versions of libcurl).
We should switch to warning all the time since this series adds in
default whitelisted/blacklisted protocols anyways.
--
Brandon Williams
gt; think it was really planned out, and it obviously is inconsistent with
> the other repo-discovery cases. But it is a convenient side effect for
> submodules, and I doubt anybody is bothered by it in practice.
>
> -Peff
I think this more robust check is probably a good idea, that way we
don't step into a submodule with a .git directory that isn't really a
.git dir.
--
Brandon Williams
On 12/01, Jeff King wrote:
> On Thu, Dec 01, 2016 at 10:14:15AM -0800, Brandon Williams wrote:
>
> > > 1. The new policy config lets you say "only allow this protocol when
> > > the user specifies it". But when http.c calls is_transport_allowed(),
> &g
Now that there are default "known-good" and "known-bad" protocols which
are allowed/disallowed by 'is_transport_allowed' we should always warn
the user that older versions of libcurl can't respect the allowed
protocols for redirects.
Signed-off-by: Bra
Add a the 'redirect' parameter to 'is_transport_allowed' which allows
callers to query if a transport protocol can be used on a redirect.
Signed-off-by: Brandon Williams
---
http.c | 8
transport.c | 6 +++---
transport.h | 7 ---
3 files changed,
atch by Jeff King
Signed-off-by: Brandon Williams
---
Documentation/config.txt | 46 ++
Documentation/git.txt| 38 +---
git-submodule.sh | 12 ++--
t/lib-proto-disable.sh | 130 +--
t/t5509-
v6 introduces 2 additional patches which address problems with protocols that
libcurl is allowed to use for redirection.
Brandon Williams (4):
lib-proto-disable: variable name fix
transport: add protocol policy config option
http: always warn if libcurl version is too old
transport: check
The test_proto function assigns the positional parameters to named
variables, but then still refers to "$desc" as "$1". Using $desc is
more readable and less error-prone.
Signed-off-by: Brandon Williams
---
t/lib-proto-disable.sh | 12 ++--
1 file changed, 6 insert
Add a the 'redirect' parameter to 'is_transport_allowed' which allows
callers to query if a transport protocol can be used on a redirect.
Signed-off-by: Brandon Williams
---
http.c | 8
transport.c | 6 +++---
transport.h | 7 ---
3 files changed,
On 12/01, Brandon Williams wrote:
> Add a the 'redirect' parameter to 'is_transport_allowed' which allows
> callers to query if a transport protocol can be used on a redirect.
>
> Signed-off-by: Brandon Williams
> ---
> http.c | 8
>
On 12/01, Jeff King wrote:
> On Thu, Dec 01, 2016 at 11:35:24AM -0800, Brandon Williams wrote:
>
> > > I wouldn't expect anyone to ever set GIT_PROTOCOL_FROM_USER=1, but it
> > > does behave in a funny way here, overriding the "redirect" flag. I th
er;
>
> which is pretty clear. Nobody would ever pass "1" as from_user to the
> function, but it does the sensible thing if they do.
>
> -Peff
>
> [1] The original I posted calling it "redirect" was totally bogus
> because the logic between the two names is inverted.
--
Brandon Williams
Changed the last patch in the series to use the parameter 'from_user' instead
of 'redirect'. This allows us to use the same logic polarity and maintain use
of the same vocabulary.
Brandon Williams (4):
lib-proto-disable: variable name fix
transport: add protocol policy
should be provided which falls back to reading `GIT_PROTOCOL_FROM_USER`
to determine if the protocol came from the user.
Signed-off-by: Brandon Williams
---
http.c | 8
transport.c | 8 +---
transport.h | 13 ++---
3 files changed, 19 insertions(+), 10 deletions(-)
diff --gi
Now that there are default "known-good" and "known-bad" protocols which
are allowed/disallowed by 'is_transport_allowed' we should always warn
the user that older versions of libcurl can't respect the allowed
protocols for redirects.
Signed-off-by: Bra
The test_proto function assigns the positional parameters to named
variables, but then still refers to "$desc" as "$1". Using $desc is
more readable and less error-prone.
Signed-off-by: Brandon Williams
---
t/lib-proto-disable.sh | 12 ++--
1 file changed, 6 insert
atch by Jeff King
Signed-off-by: Brandon Williams
---
Documentation/config.txt | 46 ++
Documentation/git.txt| 38 +---
git-submodule.sh | 12 ++--
t/lib-proto-disable.sh | 130 +--
t/t5509-
On 12/01, Brandon Williams wrote:
> On 12/01, Jeff King wrote:
> > On Thu, Dec 01, 2016 at 10:46:23AM -0800, Junio C Hamano wrote:
> >
> > > > mkpath() is generally an unsafe function because it uses a static
> > > > buffer, but it's handy and safe for
y's server, then Alice will leak the
> > existence of those sha1s to her.
> ----------^^^
> ... to _him_ ? (again Mallory)
>
> ATB,
> Ramsay Jones
Depends, I only know Mallorys who are women so her seems appropriate.
--
Brandon Williams
llowed to be passed to curl? Is that
because curl only understands those particular protocols?
--
Brandon Williams
On 12/01, Jeff King wrote:
> On Thu, Dec 01, 2016 at 12:25:59PM -0800, Brandon Williams wrote:
>
> > Add the from_user parameter to the 'is_transport_allowed' function.
> > This allows callers to query if a transport protocol is allowed, given
> > that the caller
On 12/01, Brandon Williams wrote:
> On 12/01, Jeff King wrote:
> > On Thu, Dec 01, 2016 at 12:25:59PM -0800, Brandon Williams wrote:
> >
> > > Add the from_user parameter to the 'is_transport_allowed' function.
> > > This allows callers to quer
On 12/01, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > I started taking a look at your http redirect series (I really should
> > have taking a look at it sooner) and I see exactly what you're talking
> > about. We can easily move this logic into a func
The test_proto function assigns the positional parameters to named
variables, but then still refers to "$desc" as "$1". Using $desc is
more readable and less error-prone.
Signed-off-by: Brandon Williams
---
t/lib-proto-disable.sh | 12 ++--
1 file changed, 6 insert
Now that there are default "known-good" and "known-bad" protocols which
are allowed/disallowed by 'is_transport_allowed' we should always warn
the user that older versions of libcurl can't respect the allowed
protocols for redirects.
Signed-off-by: Bra
e provided which falls back to reading `GIT_PROTOCOL_FROM_USER`
to determine if the protocol came from the user.
Signed-off-by: Brandon Williams
---
http.c | 12 ++--
transport.c | 8 +---
transport.h | 13 ++---
3 files changed, 21 insertions(+), 12 deletions(-)
di
v8 of this series moves the creation of an allowed protocol whitelist for
CURLOPT_REDIR_PROTOCOLS to a helper function. This is to help out another
series which depends on the creation of a whitelist for CURLOPT_PROTOCOLS.
Brandon Williams (5):
lib-proto-disable: variable name fix
transport
atch by Jeff King
Signed-off-by: Brandon Williams
---
Documentation/config.txt | 46 ++
Documentation/git.txt| 38 +---
git-submodule.sh | 12 ++--
t/lib-proto-disable.sh | 130 +--
t/t5509-
Move the creation of an allowed protocols whitelist to a helper
function.
Signed-off-by: Brandon Williams
---
http.c | 27 +--
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/http.c b/http.c
index fee128b..a1c3a0e 100644
--- a/http.c
+++ b/http.c
On 12/01, Jeff King wrote:
> On Thu, Dec 01, 2016 at 03:26:56PM -0800, Brandon Williams wrote:
>
> > > I started taking a look at your http redirect series (I really should
> > > have taking a look at it sooner) and I see exactly what you're talking
> > >
reason why real_path() couldn't be
re-implemented to avoid using chdir? I tried looking into the history of
the function but couldn't find anything explaining why it was done that
way. I assume it has to do with symlinks, but I thought there was a
syscall (readlink?) that could do the resolution.
--
Brandon Williams
On 12/02, Jacob Keller wrote:
> On Fri, Dec 2, 2016 at 10:36 AM, Brandon Williams wrote:
> > On 12/01, Jeff King wrote:
> >> On Thu, Dec 01, 2016 at 01:56:32PM -0800, Stefan Beller wrote:
> >>
> >> > > Bleh. Looks like it happens as part of the recentl
; From a cursory look at its man page it seems to do the symlink
> >>> resolution.
> >>>
> >>> --
> >>> Brandon Williams
> >>
> >> I believe it uses the same method and thus wouldn't actually resolve
> >> the issue. But I
> featureful (at the very least, it handles arbitrary-sized paths via
> strbufs).
I've actually been working on updating our implementation of realpath
today. Its slow going but we'll see if it works when i'm done :)
Also we can just drop in realpath since it requires that all path
components are valid, while ours allows for the final component to be
invalid.
--
Brandon Williams
aking real_path reentrant.
Signed-off-by: Brandon Williams
---
abspath.c | 183 +-
1 file changed, 122 insertions(+), 61 deletions(-)
diff --git a/abspath.c b/abspath.c
index 2825de8..6f546e0 100644
--- a/abspath.c
+++ b/abspath.c
@@
owing
threads:
https://public-inbox.org/git/20161129010538.ga121...@google.com/
https://public-inbox.org/git/1480555714-186183-1-git-send-email-bmw...@google.com/
Brandon Williams (1):
real_path: make real_path thread-safe
abspath.c
On 12/02, Stefan Beller wrote:
>
> test_expect_success '"checkout " honors diff.ignoreSubmodules' '
> @@ -63,6 +70,260 @@ test_expect_success '"checkout " honors
> submodule.*.ignore from .git/
> ! test -s actual
> '
Should you use test_must_fail and not '!'?
--
Brandon Williams
--cached base &&
> + git checkout advanced-base &&
> + git diff-files --quiet &&
> + git diff-index --quiet --cached advanced-base &&
> + git checkout --recurse-submodules base
> +'
> +
This test doesn't look like it looks into the submodule to see if the
submodule has indeed changed. Unless diff-index and diff-files recurse
into the submodules?
--
Brandon Williams
On 12/05, Stefan Beller wrote:
> On Mon, Dec 5, 2016 at 11:25 AM, Brandon Williams wrote:
> > On 12/02, Stefan Beller wrote:
> >>
> >> test_expect_success '"checkout " honors diff.ignoreSubmodules'
> >> '
> >> @@ -63,6 +70,2
>
> The long tail (i.e. the actual functionality) should actually be
> faster, I'd imagine
> as we do less than with using chdir.
Depends on how expensive the chdir calls were. And I'm working to get
rid of the static buffer. Just need have the callers own the memory
first.
--
Brandon Williams
e will be a bit more allocation
churn with the smaller scope but multiple symlinks should be rare?
Alternatively the 'next' buffer can be reused...I decided against that
initially due to readability. And yes, lots of string manipulation
requires lots of strbufs :)
> > + //strbuf_release(&resolved);
>
> This is why the cover letter toned down expectations ?
> (no // as comment, maybe remove that line?)
yep. It will be added back in though once the callers to real_path take
ownership of the memory.
--
Brandon Williams
On 12/05, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > On 12/01, Junio C Hamano wrote:
> >> Brandon Williams writes:
> >>
> >> > I started taking a look at your http redirect series (I really should
> >> > have taking a lo
On 12/05, Stefan Beller wrote:
> On Mon, Dec 5, 2016 at 11:29 AM, Brandon Williams wrote:
> > On 12/02, Stefan Beller wrote:
> >> +test_expect_success 'option checkout.recurseSubmodules updates submodule'
> >> '
> >> + test_config checkout.
On 12/05, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > I just took Jeff's series and applied it on top of mine (and fixed the
> > small problem causing t5812 to fail) and then rebased it to v2.9.0.
> > There were a few issues that needed to be resolved but
d(int argc, const char **argv, const
> > char *prefix, int patch)
> > {
> > struct pathspec pathspec;
> >
> > - parse_pathspec(&pathspec, 0,
> > + parse_pathspec(&pathspec, 0,
> >PATHSPEC_PREFER_FULL |
> >PATHSPEC_SYMLINK_LEADING_PATH |
> >PATHSPEC_PREFIX_ORIGIN,
I've been doing a bit of work trying to clean up the pathspec
initialization code and I believe this can be fixed without
having to add in this work around. The code which does the munging is
always trying to prefix the pathspec regardless if there is a prefix or
not. If instead its changed to only try and prefix the original if
there is indeed a prefix, then it should fix the munging.
I'll try to get the series I'm working on out in the next day.
--
Brandon Williams
pathspec elements as an intermediate step (with modificationed based on
the passed in flags). This way the intermediate strings can then be
freed prior to duplicating the result of parse_pathspec (which contains
each of the elements with the prefix prepended).
Signed-off-by: Brandon Williams
--
Convert 'create_simplify()' to use the pathspec struct interface from
using the '_raw' entry in the pathspec.
Signed-off-by: Brandon Williams
---
dir.c | 25 -
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/dir.c b/dir.c
index bfa
ode into their own helper
functions. The overall result is a much more readable function.
Brandon Williams (17):
mv: convert to using pathspec struct interface
dir: convert create_simplify to use the pathspec struct interface
dir: convert fill_directory to use the pathspec struct interface
ls-tre
Convert 'fill_directory()' to use the pathspec struct interface from
using the '_raw' entry in the pathspec struct.
Signed-off-by: Brandon Williams
---
dir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dir.c b/dir.c
index 7df292b..8730a4f 100644
---
ct, they need to be freed when clearing the
pathspec struct (in 'clear_pathspec()') and duplicated when copying the
pathspec struct (in 'copy_pathspec()').
Also change the type of 'match' and 'original' to 'char *' in order to
more explicitly show the
more general
situations.
Also, slightly change the logic which decides when to prefix the
original element in order to prevent a pathspec of "." from getting
converted to "" (empty string).
Signed-off-by: Brandon Williams
---
pathspec.c | 33 +--
more easily search the man pages for that magic type.
This also avoids passing an extra parameter around the pathspec
initialization code.
Signed-off-by: Brandon Williams
---
pathspec.c | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/pathspec.c b/pathspec.c
Convert 'show_recursive()' to use the pathspec struct interface from
using the '_raw' entry in the pathspec struct.
Signed-off-by: Brandon Williams
---
builtin/ls-tree.c | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/builtin/ls-tree.c b/bui
301 - 400 of 2393 matches
Mail list logo