Skip to content

t3429: use test_path_is_file helper - #2274

Open
Joiejoie1 wants to merge 1 commit into
gitgitgadget:masterfrom
Joiejoie1:outreachy/test-path-helper
Open

Joiejoie1 wants to merge 1 commit into
gitgitgadget:masterfrom
Joiejoie1:outreachy/test-path-helper

Conversation

@Joiejoie1

@Joiejoie1 Joiejoie1 commented Oct 21, 2026 •

Copy link
Copy Markdown

Replace test -e F with test_path_is_file F in t3429-rebase-edit-todo.sh to use Git's semantic test helper and provide better diagnostics on failure.

Tested with:

make NO_ICONV=YesPlease test T=t3429-rebase-edit-todo.sh

All 7 tests passed.

CC: Usman Akinyemi <usmanakinyemi202@gmail.com>
CC: Christian Couder <christian.couder@gmail.com>
cc: Usman Akinyemi usmanakinyemi202@gmail.com

Signed-off-by: Joy Gundu <soniqjjj@gmail.com>
@Joiejoie1

Copy link
Copy Markdown
Author

/submit

@gitgitgadget

gitgitgadget Bot commented Oct 21, 2026

Copy link
Copy Markdown

Submitted as pull.2274.git.1792582249420.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2274/Joiejoie1/outreachy/test-path-helper-v1

To fetch this version to local tag pr-2274/Joiejoie1/outreachy/test-path-helper-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2274/Joiejoie1/outreachy/test-path-helper-v1

@gitgitgadget

gitgitgadget Bot commented Oct 21, 2026

Copy link
Copy Markdown

This patch series was integrated into seen via git@106d3fb.

@gitgitgadget gitgitgadget Bot added the seen label Oct 21, 2026
@gitgitgadget

gitgitgadget Bot commented Oct 22, 2026

Copy link
Copy Markdown

Usman Akinyemi wrote on the Git mailing list (how to reply to this email):

On Wed, Oct 21, 2026 at 12:30 PM Joy via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Joy Gundu <soniqjjj@gmail.com>
>
> Signed-off-by: Joy Gundu <soniqjjj@gmail.com>
> ---
>     t3429: use test_path_is_file helper
>
>     Replace test -e F with test_path_is_file F in t3429-rebase-edit-todo.sh
>     to use Git's semantic test helper and provide better diagnostics on
Why is the commit message down after the dashes, isn't is supposed to
be at the top?
>         todo=.git/rebase-merge/git-rebase-todo &&
>         git rebase HEAD~1 -x "echo exec touch F >>$todo" &&
> -       test -e F
> +       test_path_is_file F
This is wrong, the initial patch is testing whether "F" exists, not whether
it is a file. The appropriate function to use here is test_patch_exists.
>  '
>
>  test_expect_success 'rebase exec with an empty list does not exec anything' '
>
> base-commit: c51408889c3b372814bc20b9431c3b74d0d268eb
> --
> gitgitgadget

@gitgitgadget

gitgitgadget Bot commented Oct 22, 2026

Copy link
Copy Markdown

User Usman Akinyemi <usmanakinyemi202@gmail.com> has been added to the cc: list.

@gitgitgadget

gitgitgadget Bot commented Oct 22, 2026

Copy link
Copy Markdown

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

Usman Akinyemi <usmanakinyemi202@gmail.com> writes:

> On Wed, Oct 21, 2026 at 12:30 PM Joy via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Joy Gundu <soniqjjj@gmail.com>
>>
>> Signed-off-by: Joy Gundu <soniqjjj@gmail.com>
>> ---
>>     t3429: use test_path_is_file helper
>>
>>     Replace test -e F with test_path_is_file F in t3429-rebase-edit-todo.sh
>>     to use Git's semantic test helper and provide better diagnostics on
> Why is the commit message down after the dashes, isn't is supposed to
> be at the top?

(tip: leave a blank line between what they write and what you write,
both before and after)

It is a common mistake of GGG users.  When they write an empty
commit message and then elaborate in the pull request message, we
see something like what we are looking at.

>>         todo=.git/rebase-merge/git-rebase-todo &&
>>         git rebase HEAD~1 -x "echo exec touch F >>$todo" &&
>> -       test -e F
>> +       test_path_is_file F
> This is wrong, the initial patch is testing whether "F" exists, not whether
> it is a file. The appropriate function to use here is test_patch_exists.
>>  '
>>
>>  test_expect_success 'rebase exec with an empty list does not exec anything' '
>>
>> base-commit: c51408889c3b372814bc20b9431c3b74d0d268eb
>> --
>> gitgitgadget

@gitgitgadget

gitgitgadget Bot commented Oct 22, 2026

Copy link
Copy Markdown

This branch is now known as jg/t3429-test-path-is-file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant