#671174 vidir: interact with version control systems

Package:
moreutils
Source:
moreutils
Description:
additional Unix utilities
Submitter:
Enrico Zini
Date:
2013-07-28 15:15:11 UTC
Severity:
wishlist
#671174#5
Date:
2012-05-02 09:54:14 UTC
From:
To:
Hello,

when using vidir in a directory under a VCS, it would be awesome if it
could issue "svn mv" or "git mv" instead of just renames.

I'd accept this bug to be considered invalid, though, as it has the
potential of complicating vidir's code considerably.

An alternate strategy would be to implement a vcs-friendly 'mv' command,
and have vidir use it if available.


Ciao,

Enrico

#671174#10
Date:
2012-05-02 16:21:56 UTC
From:
To:
Enrico Zini wrote:

This may fall under my general TODO of making vidir be able to run
arbitrary commands intelligently based on properties of the files,
compressing/uncompressing/converting/moving/etc. I have never yet sat down
and came up with a configuration file format that it could use to define
these types of actions in a sane and clear way. I seem to have a mental
block about that, as all I can think of is some nasty pattern matching
thing, or a full-fledged programming language thing.

#671174#15
Date:
2013-07-28 15:03:26 UTC
From:
To:
How about just allowing the user to specify a script?  Then you could
execute, e.g.,
  "$script" mv -- "$old" "$new"
  "$script" rm -- "$old"

$script=git would work as expected; anything more complex like
compression/conversion could be implemented with a wrapper.

If it were possible to configure a default script, I could try to detect
whether the files were in a repository and run "git mv" or "mv" (etc.)
as appropriate.