On Tue, Jan 03, 2017 at 05:48:35PM -0800, Stefan Beller wrote:
> Every once in a while someone complains to the mailing list to have
> run into this weird assertion[1]. The usual response from the mailing
> list is link to old discussions[2], and acknowledging the problem
> stating it is known.
>
On Mon, Jan 02, 2017 at 12:14:49PM +0100, Michael J Gruber wrote:
> Currently, the headers "error: ", "warning: " etc. - generated by die(),
> warning() etc. - are not localized, but we feed many localized error messages
> into these functions so that we produce error messages with mixed
>
On Wed, Jan 04, 2017 at 07:56:02AM +0100, Torsten Bögershausen wrote:
> On 04.01.17 01:48, Jeff King wrote:
> > On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote:
> >
> >> Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back to
> >> MAXDEPTH due to a naming
On 04.01.17 01:48, Jeff King wrote:
> On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote:
>
>> Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back to
>> MAXDEPTH due to a naming conflict brought up by Lars Schneider.
>
> Hmm. Isn't MAXSYMLINKS basically what you
> It MIGHT be a handy hack when writing a test, but let's stop doing
> that insanity. No sane project does that in real life, doesn't it?
> Create a subdirectory, make it a repository, have a commit there and
> bind that as our own submodule. That would be a more normal way to
> start your own
In reality nobody would run "git submodule add ./. "
to add the repository to itself as a submodule as this comes with some
nasty surprises, such as infinite recursion when cloning that repository.
However we do this all the time in the test suite, because most of the
time this was the most
Every once in a while someone complains to the mailing list to have
run into this weird assertion[1]. The usual response from the mailing
list is link to old discussions[2], and acknowledging the problem
stating it is known.
This patch accomplishes two things:
1. Switch assert() to die("BUG")
On Tue, Jan 03, 2017 at 10:15:38AM -0800, Stefan Beller wrote:
> > I take that the new "BUG" thing tells the Git developers that no
> > sane codepath should throw an pathspec_item that satisfies the
> > condition of the if() statement for non-submodules?
>
> If we want to keep the semantics of
On Tue, Jan 03, 2017 at 10:30:47AM -0800, Stefan Beller wrote:
> In C code we have the luxury of having constants for all the important
> things that are hard coded. This is the only place in C, that hard codes
> the git directory environment variable, so fix it.
>
> Signed-off-by: Stefan Beller
On Tue, Jan 3, 2017 at 10:47 AM, Stefan Beller wrote:
> On Mon, Jan 2, 2017 at 11:05 AM, Paul Sbarra wrote:
>>> I would have expected `git difftool --submodule=diff ...` to work... What
>>> are the problems?
>>
>> The docs for difftool state...
>> "git
On Tue, Jan 03, 2017 at 12:11:25PM -0800, Stefan Beller wrote:
> On Mon, Jan 2, 2017 at 8:22 AM, Johannes Schindelin
> wrote:
> > Technically, it is correct that git_exec_path() returns a possibly
> > malloc()ed string. Practically, it is *sometimes* not malloc()ed.
On Tue, Jan 3, 2017 at 11:09 AM, Brandon Williams wrote:
> Migrate callers of real_path() who duplicate the retern value to use
> real_pathdup or strbuf_realpath.
Nit: s/retern/return
If rerere is enabled, no pathnames are given, and mergetool is run
from a subdirectory, mergetool always prints "No files need merging".
Fix the bug.
This regression was introduced in
57937f70a09c12ef484c290865dac4066d207c9c (v2.11.0).
Richard Hansen (4):
t7610: update branch names to match
Rename the testNN branches so that NN matches the test number. This
should make it easier to troubleshoot test issues. Use $test_count to
keep this future-proof.
Signed-off-by: Richard Hansen
---
t/t7610-mergetool.sh | 82
If rerere is enabled and no pathnames are given, run cd_to_toplevel
before running 'git diff --name-only' so that 'git diff --name-only'
sees the pathnames emitted by 'git rerere remaining'.
Also run cd_to_toplevel before running 'git rerere remaining' in case
'git rerere remaining' is ever
If rerere is enabled and mergetool is run from a subdirectory,
mergetool always prints "No files need merging". Add an expected
failure test case for this situation.
Signed-off-by: Richard Hansen
---
t/t7610-mergetool.sh | 21 -
1 file changed, 20
If a test fails it might leave the repository in a strange state. Add
'git reset --hard' at the beginning of each test to increase the odds
of passing when an earlier test fails.
Also use test-specific branches to avoid interfering with later tests
and to make the tests easier to debug.
On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote:
> Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back to
> MAXDEPTH due to a naming conflict brought up by Lars Schneider.
Hmm. Isn't MAXSYMLINKS basically what you want here, though? It what's
what all other
On Tue, Jan 03, 2017 at 06:24:39PM +0100, René Scharfe wrote:
> Am 02.01.2017 um 23:25 schrieb Jeff King:
> > Since 4aff646d17 (archive-zip: mark text files in archives,
> > 2015-03-05), the zip archiver will look at the userdiff
> > driver to decide whether a file is text or binary. This
> >
On Mon, Jan 2, 2017 at 8:22 AM, Johannes Schindelin
wrote:
> Technically, it is correct that git_exec_path() returns a possibly
> malloc()ed string. Practically, it is *sometimes* not malloc()ed. So
> let's just use a static variable to make it a singleton. That'll
Looks good to me.
Ori Rawlings
test_must_fail should only be used for testing git commands. To test the
failure of other commands use `!`.
Reported-by: Stefan Beller
Signed-off-by: Pranit Bauva
---
t/t3510-cherry-pick-sequence.sh | 6 +++---
t/t5504-fetch-receive-strict.sh | 2
The exit code of the upstream in a pipe is ignored thus we should avoid
using it. By writing out the output of the git command to a file, we can
test the exit codes of both the commands.
Signed-off-by: Pranit Bauva
---
t/t9813-git-p4-preserve-users.sh | 8
1
>
> git p4 commit >actual &&
> grep "git author de...@example.com does not match" actual &&
>
> What do you think?
>From the travis logs:
'actual.err' is not empty, it contains:
... - file(s) up-to-date.
I think(/hope) such a progress is tested for at another test,
and not relevant here
Hey Stefan,
On Tue, Jan 3, 2017 at 11:28 PM, Stefan Beller wrote:
> On Mon, Jan 2, 2017 at 10:45 AM, Pranit Bauva wrote:
>> The exit code of the upstream in a pipe is ignored thus we should avoid
>> using it.
>
> for commands under test, i.e. git
On Mon, Jan 2, 2017 at 3:14 AM, Michael J Gruber
wrote:
> Currently, the headers "error: ", "warning: " etc. - generated by die(),
> warning() etc. - are not localized, but we feed many localized error messages
> into these functions so that we produce error messages
On Fri, Dec 30, 2016 at 2:50 AM, Tor Andersson wrote:
> Hi,
>
> When adding submodules with --depth=1 only the master branch is
> cloned. This often leaves the submodule pointing to a non-existing
> commit.
You can also use the "--branch=not_master" flag to track another branch.
Give a more relevant name to the prefix_pathspec function as it does
more than just prefix a pathspec element.
Signed-off-by: Brandon Williams
---
pathspec.c | 24 +++-
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/pathspec.c b/pathspec.c
Factor out the logic responsible for parsing long magic into its own
function. As well as hoist the prefix check logic outside of the inner
loop as there isn't anything that needs to be done after matching
"prefix:".
Signed-off-by: Brandon Williams
---
pathspec.c | 92
Create real_pathdup which returns a caller owned string of the resolved
realpath based on the provide path.
Signed-off-by: Brandon Williams
---
abspath.c | 13 +
cache.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/abspath.c b/abspath.c
index
Migrate callers of real_path() who duplicate the retern value to use
real_pathdup or strbuf_realpath.
Signed-off-by: Brandon Williams
---
builtin/init-db.c | 6 +++---
environment.c | 2 +-
setup.c | 13 -
sha1_file.c | 2 +-
submodule.c
Change the name of real_path_internal to strbuf_realpath. In addition
push the static strbuf up to its callers and instead take as a
parameter a pointer to a strbuf to use for the final result.
This change makes strbuf_realpath reentrant.
Signed-off-by: Brandon Williams
---
From: Johannes Sixt
When an absolute path is resolved, resolution begins at the first path
component after the root part. The root part is just copied verbatim,
because it must not be inspected for symbolic links. For POSIX paths,
this is just the initial slash, but on Windows,
The current implementation of real_path uses chdir() in order to resolve
symlinks. Unfortunately this isn't thread-safe as chdir() affects a
process as a whole and not just an individual thread. Instead perform
the symlink resolution by hand so that the calls to chdir() can be
removed, making
Teach simplify_away() and exclude_matches_pathspec() to handle struct
pathspec directly, eliminating the need for the struct path_simplify.
Also renamed the len parameter to pathlen in exclude_matches_pathspec()
to match the parameter names used in simplify_away().
Signed-off-by: Brandon
Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back to
MAXDEPTH due to a naming conflict brought up by Lars Schneider.
Brandon Williams (4):
real_path: resolve symlinks by hand
real_path: convert real_path_internal to strbuf_realpath
real_path: create real_pathdup
v4 addresses a few comments from Duy.
* [2/16] push the guard pathspec macro into simplify_away() and
exclude_matches_pathsepc().
* [6/16] when freeing a pathspec struct, set pathsepc->nr = 0.
* [8/16] tweak the die message when using unsupported magic to be more human
readable.
Brandon
On 12/29, Lars Schneider wrote:
>
> > On 28 Dec 2016, at 00:11, Junio C Hamano wrote:
> >
> >
> > * bw/realpath-wo-chdir (2016-12-22) 5 commits
> > (merged to 'next' on 2016-12-22 at fea8fa870f)
> > + real_path: canonicalize directory separators in root parts
> > +
A few small changes to improve readability. This is done by grouping related
assignments, adding blank lines, ensuring lines are <80 characters, and
adding additional comments.
Signed-off-by: Brandon Williams
---
pathspec.c | 25 +++--
1 file changed, 15
Factor out the logic responsible for the magic in a pathspec element
into its own function.
Also avoid calling into the parsing functions when
`PATHSPEC_LITERAL_PATH` is specified since it causes magic to be
ignored and all paths to be treated as literals.
Signed-off-by: Brandon Williams
Factor out the logic responsible for parsing short magic into its own
function.
Signed-off-by: Brandon Williams
---
pathspec.c | 54 --
1 file changed, 36 insertions(+), 18 deletions(-)
diff --git a/pathspec.c b/pathspec.c
The 'original' string entry in a pathspec_item is only duplicated some
of the time, instead always make a copy of the original and take
ownership of the memory.
Since both 'match' and 'original' string entries in a pathspec_item are
owned by the pathspec struct, they need to be freed when
Now that all callers of the old 'get_pathspec' interface have been
migrated to use the new pathspec struct interface it can be removed
from the codebase.
Since there are no more users of the '_raw' field in the pathspec struct
it can also be removed. This patch also removes the old functionality
Factor out the logic responsible for stripping the trailing slash on
pathspecs referencing submodules into its own function.
Signed-off-by: Brandon Williams
---
pathspec.c | 68 ++
1 file changed, 42 insertions(+),
Removed unused variable 'n' from the 'unsupported_magic()' function.
Signed-off-by: Brandon Williams
---
pathspec.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pathspec.c b/pathspec.c
index b8faa8f46..b9a3819d6 100644
--- a/pathspec.c
+++
For better clarity, always show the mnemonic and name of the unsupported
magic being used. This lets users have a more clear understanding of
what magic feature isn't supported. And if they supplied a mnemonic,
the user will be told what its corresponding name is which will allow
them to more
The logic used to prefix an original pathspec element with 'prefix'
magic is more general purpose and can be used for more than just short
magic. Remove the extra code paths and rename 'prefix_short_magic' to
'prefix_magic' to better indicate that it can be used in more general
situations.
Also,
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 | 16 +++-
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/builtin/ls-tree.c
Convert the 'internal_copy_pathspec()' function to 'prefix_path()'
instead of using the deprecated 'get_pathspec()' interface. Also,
rename 'internal_copy_pathspec()' to 'internal_prefix_pathspec()' to be
more descriptive of what the funciton is actually doing.
In addition to this, fix a memory
Create helper functions to read the global magic environment variables
in additon to factoring out the global magic gathering logic into its
own function.
Signed-off-by: Brandon Williams
---
pathspec.c | 127 +
1
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 | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dir.c b/dir.c
index
On Mon, Jan 2, 2017 at 11:05 AM, Paul Sbarra wrote:
>> I would have expected `git difftool --submodule=diff ...` to work... What
>> are the problems?
>
> The docs for difftool state...
> "git difftool is a frontend to git diff and accepts the same options
> and arguments."
In C code we have the luxury of having constants for all the important
things that are hard coded. This is the only place in C, that hard codes
the git directory environment variable, so fix it.
Signed-off-by: Stefan Beller
---
v2:
argv_array_pushf and realigned.
v1:
On Sat, Dec 31, 2016 at 5:11 PM, Junio C Hamano wrote:
> Stefan Beller writes:
>
>> Every once in a while someone complains to the mailing list to have
>> run into this weird assertion[1].
>>
>> The usual response from the mailing list is link to old
On 01/03, Duy Nguyen wrote:
> On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams wrote:
> > @@ -340,8 +336,9 @@ static void NORETURN unsupported_magic(const char
> > *pattern,
> > continue;
> > if (sb.len)
> >
On Mon, Jan 2, 2017 at 10:45 AM, Pranit Bauva wrote:
> The exit code of the upstream in a pipe is ignored thus we should avoid
> using it.
for commands under test, i.e. git things. Other parts can be piped if that makes
the test easier. Though I guess that can be guessed
On 01/03, Duy Nguyen wrote:
> On Thu, Dec 29, 2016 at 5:06 PM, Duy Nguyen wrote:
> > On Thu, Dec 29, 2016 at 1:18 AM, Brandon Williams wrote:
> >> On 12/27, Junio C Hamano wrote:
> >>> * bw/pathspec-cleanup (2016-12-14) 16 commits
> >>> - pathspec: rename
On Sat, Dec 31, 2016 at 3:44 AM, Pranit Bauva wrote:
> test_must_fail should only be used for testing git commands. To test the
> failure of other commands use `!`.
>
> Reported-by: Stefan Beller
> Signed-off-by: Pranit Bauva
Am 02.01.2017 um 23:25 schrieb Jeff King:
Since 4aff646d17 (archive-zip: mark text files in archives,
2015-03-05), the zip archiver will look at the userdiff
driver to decide whether a file is text or binary. This
usually doesn't need to look any further than the attributes
themselves (e.g.,
Add missing usage description for stash subcommands
'create' and 'store'.
Signed-off-by: Marc Strapetz
---
git-stash.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/git-stash.sh b/git-stash.sh
index 10c284d1a..c6b9db694 100755
---
Expose internal option to include untracked files
for the stash 'create' subcommand.
Signed-off-by: Marc Strapetz
---
Documentation/git-stash.txt | 2 +-
git-stash.sh| 14 --
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git
Christian Couder writes:
> Ok, I will add a patch to update the style of the existing tests at
> the beginning of the series and then use the same new style in the
> tests I add in later patches.
That's not what I meant---I was expecting and was willing to accept
a
On Mon, Jan 2, 2017 at 6:14 PM, Michael J Gruber
wrote:
> Currently, the headers "error: ", "warning: " etc. - generated by die(),
> warning() etc. - are not localized, but we feed many localized error messages
> into these functions so that we produce error messages
On Thu, Dec 29, 2016 at 5:06 PM, Duy Nguyen wrote:
> On Thu, Dec 29, 2016 at 1:18 AM, Brandon Williams wrote:
>> On 12/27, Junio C Hamano wrote:
>>> * bw/pathspec-cleanup (2016-12-14) 16 commits
>>> - pathspec: rename prefix_pathspec to init_pathspec_item
On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams wrote:
> @@ -340,8 +336,9 @@ static void NORETURN unsupported_magic(const char
> *pattern,
> continue;
> if (sb.len)
> strbuf_addch(, ' ');
> - if
On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams wrote:
> void clear_pathspec(struct pathspec *pathspec)
> {
> + int i;
> +
> + for (i = 0; i < pathspec->nr; i++) {
> + free(pathspec->items[i].match);
> +
On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams wrote:
> @@ -2010,14 +1987,11 @@ static struct untracked_cache_dir
> *validate_untracked_cache(struct dir_struct *d
> return root;
> }
>
> -int read_directory(struct dir_struct *dir, const char *path, int len, const
>
67 matches
Mail list logo