fmang / opustags

Ogg Opus tags editor
BSD 3-Clause "New" or "Revised" License
75 stars 10 forks source link

Please preserve the timestamp after `--edit` if no changes are made #36

Closed rrthomas closed 3 years ago

rrthomas commented 3 years ago

It seems to me logical that if I close the editor without changing anything, the timestamp should be preserved.

fmang commented 3 years ago

To cancel edition, you need to clear the file, as stated in the comments.

Here are a few points that oriented my decision:

  1. That’s what git rebase -i and git commit --amend do.
  2. When --edit is specified along with -a, -d or -s, the tags shown are those after edition by the non-interactive options. In that case, closing the editor without saving wouldn’t mean the user wants to cancel the edition.
  3. Unix tools don’t play smart. If users say they wanted to edit a file, even if they didn’t change anything, most tools are gonna overwrite the file.
  4. It’s pretty much what happens if you write opustags -i x.opus.

Now, I get that someone may want to opustags --edit a file just to look at the tags in their editor, even without the intention to actually edit them. In that case it’s true closing the file shouldn’t do anything. Point 2 made me pick consistency with Git, but if we forbid mixing interactive and non-interactive edition then your intuition would be right, and I actually might like that better.

What do you think?

rrthomas commented 3 years ago

Fair enough!

-- https://rrt.sc3d.org

On Mon, 19 Oct 2020, 17:00 Frédéric Mangano-Tarumi, < notifications@github.com> wrote:

To cancel edition, you need to clear the file, as stated in the comments.

Here are a few points that oriented my decision:

  1. That’s what git rebase -i and git commit --amend do.
  2. When --edit is specified along with -a, -d or -s, the tags shown are those after edition by the non-interactive options. In that case, closing the editor without saving wouldn’t mean the user wants to cancel the edition.
  3. Unix tools don’t play smart. If users say they wanted to edit a file, even if they didn’t change anything, most tools are gonna overwrite the file.
  4. It’s pretty much what happens if you write opustags -i x.opus.

Now, I get that someone may want to opustags --edit a file just to look at the tags in their editor, even without the intention to actually edit them. In that case it’s true closing the file shouldn’t do anything. Point 2 made me pick consistency with Git, but if we forbid mixing interactive and non-interactive edition then your intuition would be right, and I actually might like that better.

What do you think?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fmang/opustags/issues/36#issuecomment-712265991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEHZW4WAFDOVR4KPDOIADSLRPBZANCNFSM4SWGOMKQ .

fmang commented 3 years ago

Do you mean you’re convinced by my Git mimicry, or that we should forbid non-interactive options with --edit? If you don’t see a use case for combining -s and --edit, I don’t either, so the latter option is quite good.

rrthomas commented 3 years ago

Actually, originally I was convinced by your "git mimicry", but I thought about it some more and I agree that mixing interactive and non-interactive editing is likely to lead to confusion. Also, I'm thinking that the most common way to edit tags is in a GUI, and when you do that, you normally have to click Save or some other positive action to change the tags. (I use EasyTag.)