how to let gui git accept multiple file selection to work with a custom tool?

18 Views Asked by At

how to let gui git accept multiple file selection to work with a custom tool?

in .gitconfig we can create this:

[guitool "create backup"]
    cmd = cp -vf \"$FILENAME\" \"$FILENAME.bkp\"
    noconsole = yes
    needsfile = yes

but I need to use that with 20 files...
how to do it for 20 files clicking only once in the custom tool using git gui?

I tried the above described but the custom tool will only work on the first selected file.

I found also that staging them to commit will update the .git/index binary file, so I could grep thru it, but it is binary and difficult to work with (but not impossible), so I could create a script that looks into it and does the backup, but that is a hack.

So I wonder if there is some proper way to do that? (tho, a hack could suffice also if it works well :))

0

There are 0 best solutions below