2

I upgraded to recently released Magit 2. There is a command magit-log-buffer-file. However, it logs file without --follow option, which makes it quite pointless for me (in our source code nearly everything has been moved around recently because of switch to Maven source layout). And I see no way of customizing options for logging anywhere.

Is it possible to log individual files following renames?

2

Yeah, that should be improved. magit-log-buffer-file should either always use --follow or at least with a prefix argument. Please open a feature request so that I don't forget investigating the options.

Edit Unfortunately this does not actually work (see comments):

Meanwhile you can take advantage of the fact that M-x magit-log-buffer-file respects the arguments set in the log popup.

First you have to make --follow available from that popup:

(magit-define-popup-switch 'magit-log-popup ?f "Follow renames" "--follow")

Then show the popup l, set the switch - f, and save as default C-x C-s. Of course that means that this argument will now be used when using suffix commands from the log popup too.

  • --follow can only be used when logging a single file in Git. So I cannot set that as a default. It also seems that I need to write it like (magit-define-popup-switch 'magit-log-popup ?f "Follow renames" "--follow") – doublep Jul 2 '15 at 13:07
  • A right, forgot about that. I was wondering why --follow was missing from the popup. – tarsius Jul 2 '15 at 13:23
  • ?f right. I forgot that I made that change only in some experimental feature branch. – tarsius Jul 2 '15 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.