Re: renormalize histroy with smudge/clean-filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Josef

On 05/02/2025 23:59, Josef Wolf wrote:

git rebase --root -x 'git add --renormalize . && git commit --amend --no-edit'

Unfortunately, this runs the command on every commit and gives a warning when
a cmmit don't touch a filtered file:

   $ git rebase --root -x 'git add --renormalize . && git commit --amend --no-edit'
   [ ... ]
   No changes
   You asked to amend the most recent commit, but doing so would make
   it empty. You can repeat your command with --allow-empty, or you can
   remove the commit entirely with "git reset HEAD^".

Is there a way to run the command only when rebase halts?

You could try using "git diff --cached --quiet" to avoid running "git commit" if there are no changes.

git rebase --root -x 'git add --renormalize . && { git diff --quiet --cached || git commit --amend --no-edit; }'

Best Wishes

Phillip





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux