bfg-repo-cleaner icon indicating copy to clipboard operation
bfg-repo-cleaner copied to clipboard

Chmod option

Open jkstrauss opened this issue 8 years ago • 7 comments

Added an option for BFG that allows users to change executable mode based on a file glob. This was inspired by a branch that you did as a quick fix a while back, non-executable. However, I wanted to make it more flexible.

This is my first attempt at any Scala programming, so any comments are welcome. Also, I was not sure if you want every feature to have a test case. I can always make that later if you wish.

Feel free to keep the copyright for this. I am assuming I will still be the author on as far as the Git history is concerned.

jkstrauss avatar Nov 23 '16 03:11 jkstrauss

@rtyley: Is there any chance that this could be merged?

jkstrauss avatar Mar 03 '17 04:03 jkstrauss

@jkstrauss Whilst I don't doubt that this is a well-implemented and clever feature ... I do wonder whether it is the sort of thing that it is typically worth re-writing history over, and therefore adding to core BFG. Some sort of scripting or plugin option is perhaps needed here to accommodate custom features.

I say this because - rewriting Git history, with-or-without BFG is kindof a big deal ... all other clones and histories become instantly incompatible from the first change forwards. For something like fixing file-permissions, especially for chmod +x on scripts, I would be inclined to:

  • Fix this on all active/building branch tips with a simple chmod +x and commit.
  • If you ever needed to checkout and build a historical commit, and aren't prepared to branch and add a commit to fix the permissions, run an additional build-script to run the required chmod +x first.

Is there a compelling reason that you want to undergo a history-rewrite just to fix permissions? Or is this a case of "running a history-rewrite anyway, may as well fix these too"?

javabrett avatar Jan 31 '18 21:01 javabrett

@javabrett I actually used it for my own purposes. I was importing history from CVS, and the default implementation makes all files executable. Since nobody ever saw it, I have no downside in making everything look good from the outset.

That said, if I want this feature, I can just use my fork, but others may be interested as well.

Also, is there any plan in the works for the script or plugin you mentioned?

jkstrauss avatar Feb 01 '18 15:02 jkstrauss

I tried rebasing blindly, i.e., without checking it first, and the CI build failed. For the moment, I am resetting it back to the original commit.

jkstrauss avatar Feb 01 '18 16:02 jkstrauss

@javabrett I finally succeed rebasing. Is there any reason why none of the org.scalatest imports seem to work in IntellliJ with Scala plugin? I basically had to guess how to refactor the test to meet the new way of doing things. I cannot even find any of the scalatest when using CTRL+N to search for classes.

jkstrauss avatar Feb 09 '18 04:02 jkstrauss

I don't use IntelliJ so I can't comment on if/why it can't work with scalatest.

javabrett avatar Feb 09 '18 09:02 javabrett

hashah loser

floris-xlx avatar Apr 30 '24 16:04 floris-xlx