From: JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com>
To: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Cc: git@vger.kernel.org, peff@peff.net, piotrsiupa@gmail.com
Subject: Re: [PATCH] t3706: Add test for wildcard vs literal pathspec
Date: Mon, 14 Apr 2025 22:38:39 +0530 [thread overview]
Message-ID: <CA+rGoLc=CYehMms0bxaLAu3xP-p62cMJ++RnBxSMOF2Ppt38QQ@mail.gmail.com> (raw)
In-Reply-To: <FFC5C6BE-9A4B-4EFD-AEC4-E69CE6610054@gmail.com>
On Mon, Apr 14, 2025 at 10:21 PM Lucas Seiki Oshiro
<lucasseikioshiro@gmail.com> wrote:
>
> Hi!
>
Hi Lucas,
> > +test_expect_success 'setup: create files and initial commit' '
> > + mkdir testdir &&
> > + >testdir/f\* &&
> > + >testdir/f\*\* &&
> > + >testdir/foo &&
> > + git add testdir &&
> > + git commit -m "Initial setup with literal wildcard files"
> > +'
> > +
> > +test_expect_success 'clean slate before testing wildcard behavior' '
> > + git rm -rf testdir &&
> > + git commit -m "Clean state"
> > +'
> >
> > +test_expect_success 'recreate files to test add behavior' '
> > + mkdir testdir &&
> > + >testdir/f\* &&
> > + >testdir/f\*\* &&
> > + >testdir/foo
> > +'
>
>
> Two questions:
>
> 1. Does this need to be inside a test_expect_success? It seems to me
> that those two tests cases are actually setup code for the next
> two.
>
> 2. If so, does it need to have all that setup? I could reproduce the
> bug by only running:
>
> ```
> git reset
> touch foo 'f*' 'f**'
> git add 'f*'
> git ls-files
> ```
>
Umm, I think the setup should just be a single block. I will send a
patch on this
I'm parallely working on a second patch.
> btw, this works with your code, congrats!
>
Thank you, credit goes to Peff(Jeff King) I almost lost track.
> Other idea: `?` is another wildcard for matching only one character.
> Have you tested if the same bug happens with it?
>
Yup I think that's also a great suggestion, I think consolidating setup
and adding at least a few different wildcards will be good.
> PS: while I was writing this review I pushed this to my GitHub just
> to make the CI run the entire test suite since pathspecs are a
> sensible part of Git.
>
> Take look at this, it seems that your tests aren't passing on Windows:
> https://github.com/lucasoshiro/git/actions/runs/14450183624/job/40521015897.
Oh damn!! That's a silly mistake. I almost forgot windows exist!!
Thanks for letting me know
> Perhaps you'll need to change something there. It seems to be
> related to how Windows handle paths (specially the \ character, which
> means the same as / in Unix). Personally, I'm not a Windows guy and
Same not a windows guy, but I will have to read some things out.
Will figure it out.
> can't help you further with this. A quick reference on how paths on
> Windows work is this (and yeah, they are far more complex than in
> Unix):
> https://www.fileside.app/blog/2023-03-17_windows-file-paths/
>
>
Thanks again Lucas, these help.
-Jayatheerth
next prev parent reply other threads:[~2025-04-14 17:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-12 9:46 [PATCH 0/1] add: fix pathspec handling when literal filenames match wildcard K Jayatheerth
2025-04-12 9:46 ` [PATCH 1/1] add: fix handling literal filenames and wildcards K Jayatheerth
2025-04-12 17:40 ` [PATCH] t3706: Add test for wildcard vs literal pathspec K Jayatheerth
2025-04-14 16:51 ` Lucas Seiki Oshiro
2025-04-14 17:08 ` JAYATHEERTH K [this message]
2025-04-14 21:42 ` Junio C Hamano
2025-04-15 22:32 ` brian m. carlson
2025-04-16 1:56 ` JAYATHEERTH K
2025-04-16 13:11 ` Junio C Hamano
2025-04-16 14:49 ` JAYATHEERTH K
2025-04-16 15:49 ` Lucas Seiki Oshiro
2025-04-16 16:00 ` Junio C Hamano
2025-04-19 4:59 ` JAYATHEERTH K
2025-04-19 17:43 ` Lucas Seiki Oshiro
2025-04-22 11:57 ` JAYATHEERTH K
2025-04-16 16:40 ` JAYATHEERTH K
2025-04-16 16:43 ` JAYATHEERTH K
2025-04-12 15:45 ` [PATCH 0/1] add: fix pathspec handling when literal filenames match wildcard Lucas Seiki Oshiro
2025-04-12 17:34 ` JAYATHEERTH K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+rGoLc=CYehMms0bxaLAu3xP-p62cMJ++RnBxSMOF2Ppt38QQ@mail.gmail.com' \
--to=jayatheerthkulkarni2005@gmail.com \
--cc=git@vger.kernel.org \
--cc=lucasseikioshiro@gmail.com \
--cc=peff@peff.net \
--cc=piotrsiupa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).