Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmsu mv command for moving files while retaining tags #11

Closed
tmladek opened this issue Dec 19, 2014 · 7 comments
Closed

tmsu mv command for moving files while retaining tags #11

tmladek opened this issue Dec 19, 2014 · 7 comments

Comments

@tmladek
Copy link

tmladek commented Dec 19, 2014

Since tmsu doesn't explicitly monitor filesystem changes, it'd be nice if there were an analogue of git mv - a move command that also adds the move to the staging area - for tmsu, that would move the file while updating the database so that no tag info is lost.

@0ion9
Copy link

0ion9 commented Dec 20, 2014

+1. There are other ways of tracking renames -- for example by hash, like tmsu repair does -- but this is a common task, which really belongs in core TMSU imo.

@oniony
Copy link
Owner

oniony commented Dec 20, 2014

Hi,

You can easily create a script that does this:

mv $1 $2 && tmsu repair --manual $1 $2

Thanks
Paul

Since tmsu doesn't explicitly monitor filesystem changes, it'd be nice if
there were an analogue of git mv - a move command that also adds the move
to the staging area - for tmsu, that would move the file while updating the
database so that no tag info is lost.


Reply to this email directly or view it on GitHub
#11.

@coldfix
Copy link

coldfix commented Dec 20, 2014

Hey, I think this might still be worth adding as a "porcelaine" command. Inexperienced users won't be able to guess tmsu repair --manual and will try to tmsu mv instead. Or maybe provide the possibility for aliases and define mv accordingly.

@oniony
Copy link
Owner

oniony commented Dec 20, 2014

The problem I have with it is that no commands in TMSU currently make any
modifications on disk*: right now you can trust that TMSU will never modify
your files. Adding a 'mv' command would change this and this changes the
whole relationship with the tool.

I think, as its so easy to alias this in the shell, that its not necessary.
If there's enough demand, however, I would be open to changing my position
on this.

Thanks,
Paul

  • other than to the database file

On Sat, 20 Dec 2014 16:50 Thomas G. notifications@github.com wrote:

Hey, I think this might still be worth adding as a "porcelaine" command.
Inexperienced users won't be able to guess tmsu repair --manual and will
try to tmsu mv instead. Or maybe provide the possibility for aliases and
define mv accordingly.


Reply to this email directly or view it on GitHub
#11 (comment).

@oniony
Copy link
Owner

oniony commented Dec 22, 2014

Please leave a +1 comment on this if you would like to see 'mv' subcommand:

$ tmsu mv /old/path /new/path

Which would be equivalent to:

$ mv /old/path /new/path && tmsu repair --manual /old/path /new/path

@coldfix
Copy link

coldfix commented Dec 22, 2014

I'd vote rather for some checked version similar to this: (;but maybe not implemented in shell;)

(
 ([[ -e /new/path ]] && ! [[ -e /old/path ]]) ||
 (! [[ -e /new/path ]] && mv /old/path /new/path)
) &&
tmsu repair --manual /old/path new/path

Making 'mv' a short and easy to remember fix when the file was already moved on disk.

@oniony
Copy link
Owner

oniony commented Apr 14, 2015

OK, after looking at issue #20, I've decided I'll include a set of shell functions with TMSU. Currently I have:

  • tmsu-rm
  • tmsu-mv
  • tmsu-mergefiles

This should allow users to do these operations simply without TMSU itself performing any changes to the managed files on disk.

I've created a new issue #35 for this.

@oniony oniony closed this as completed Apr 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants