Re: git wants to commit more files than expected ?

From: Warner Losh <imp_at_bsdimp.com>
Date: Sat, 13 Aug 2022 15:54:37 UTC
On Sat, Aug 13, 2022 at 9:45 AM Nuno Teixeira <eduardo@freebsd.org> wrote:

> Hi,
>
> I always forgot to use `git commit --amend` when commit needed some
> correction/change. I usually do a `git reset --hard ^HEAD` and then commit
> from scratch :)
>
> Next commit I do I will use amend and see if I got similar problem like
> yours.
>

git rebase -i freebsd/main main

is what I do when I'm working on main and need to 'curate' the commits.

Warner


> Cheers,
>
> Kurt Jaeger <pi@freebsd.org> escreveu no dia sábado, 13/08/2022 à(s)
> 16:27:
>
>> Hi!
>>
>> > > But if I run a git commit, additional two files turn up:
>> > >
>> > > # Changes to be committed:
>> > > #       modified:   archivers/py-borgbackup/Makefile
>> > > #       new file:   archivers/py-borgbackup/files/patch-setup.py
>> > > #       modified:   print/pdf-tools/Makefile
>> > > #       modified:   print/pdf-tools/distinfo
>> > >
>> > > Why isn't git status not reporting the two pdf-tools files,
>> > > but git commit is ?
>> >
>> > Could you share the 'git commit' command-line that you're using ?
>>
>> It was this:
>>
>> git commit --amend --author='Jose G. Juanino <jjuanino@gmail.com>'
>> archivers/py-borgbackup
>>
>> > If I've to guess then you're probably including the '-a' switch of git
>> > commit. If yes, then please don't include it.
>>
>> I now tried this:
>>
>> git commit --author='Jose G. Juanino <jjuanino@gmail.com>'
>> archivers/py-borgbackup
>>
>> and it worked! Thanks!
>>
>> --
>> pi@FreeBSD.org         +49 171 3101372                  Now what ?
>>
>>
>
> --
> Nuno Teixeira
> FreeBSD Committer (ports)
>