Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45705

Git clean before or after checkout should call git clean -ffdx (2 "f"s)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.60.2
    • Similar Issues:

      Description

      Git help says:

      -f, --force
      If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or
      directories unless given -f, -n or -i. Git will refuse to delete directories with .git sub directory or file unless a second
      -f is given.

       

      There is no point in keeping alive directories with .git sub directories, since when dealing with submodules there might be branches that add a new submodule that is not present in another one, and when building accross them, submodule garbage will be left out.

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment -

            Closing this as a duplicate of JENKINS-29893 and JENKINS-39111. The comments in those bug reports provide a good summary of the many different use cases which would be broken if the extra "force" option were added unconditionally.

            Pull requests have been submitted proposing to optionally allow clean with the extra force option, and to allow clean with the extra force option and exclusion lists.

            I'd love to have help from others evaluating if those pull requests meet your needs as well.

            Show
            markewaite Mark Waite added a comment - Closing this as a duplicate of JENKINS-29893 and JENKINS-39111 . The comments in those bug reports provide a good summary of the many different use cases which would be broken if the extra "force" option were added unconditionally. Pull requests have been submitted proposing to optionally allow clean with the extra force option , and to allow clean with the extra force option and exclusion lists . I'd love to have help from others evaluating if those pull requests meet your needs as well.
            Hide
            lucasocio Leandro Lucarella added a comment -

            I don't understand, if you add an option to *clean* the repository, how are you expecting for some files not to be cleaned? I can understand an option to add inclusions would be useful for some, but having an action that is call "clean workspace" that is not really cleaning the workspace seems broken.

            Show
            lucasocio Leandro Lucarella added a comment - I don't understand, if you add an option to * clean * the repository, how are you expecting for some files not to be cleaned? I can understand an option to add inclusions would be useful for some, but having an action that is call "clean workspace" that is not really cleaning the workspace seems broken.
            Hide
            lucasocio Leandro Lucarella added a comment -

            In any case, I will comment on the PRs, at least the one adding the option to force clean would work for me to fix this, but I think it's backwards, you should have options to "not really clean the repository" if you add an action called "clean the repository".

            Show
            lucasocio Leandro Lucarella added a comment - In any case, I will comment on the PRs, at least the one adding the option to force clean would work for me to fix this, but I think it's backwards, you should have options to "not really clean the repository" if you add an action called "clean the repository".
            Hide
            lucasocio Leandro Lucarella added a comment -

            Also, just by the fact that some PR will tangentially fix this too, it doesn't mean it isn't a different issue. The other issues are about exclusions and timeouts, not about not a broken "clean repo" implementation.

            Show
            lucasocio Leandro Lucarella added a comment - Also, just by the fact that some PR will tangentially fix this too, it doesn't mean it isn't a different issue. The other issues are about exclusions and timeouts, not about not a broken "clean repo" implementation.
            Hide
            lucasocio Leandro Lucarella added a comment -

            At least this should be marked as resolved when it is really resolved. If the other 2 issues get fixed, this issue could still be open unless the `--force` option is added too, which is not really addressed in those issues.

            If you mark this issue as resolved, I have no way to track if/when it is really fixed, as watching the other 2 issues doesn't guarantee this will be fixed if they are fixed.

            Please keep this issue open until the underlying problem (clean not really cleaning everything) is resolved.

            Thanks!

            Show
            lucasocio Leandro Lucarella added a comment - At least this should be marked as resolved when it is really resolved. If the other 2 issues get fixed, this issue could still be open unless the `--force` option is added too, which is not really addressed in those issues. If you mark this issue as resolved, I have no way to track if/when it is really fixed, as watching the other 2 issues doesn't guarantee this will be fixed if they are fixed. Please keep this issue open until the underlying problem (clean not really cleaning everything) is resolved. Thanks!
            Hide
            lucasocio Leandro Lucarella added a comment -

            OK, this is a real duplicate of JENKINS-26660.

            Show
            lucasocio Leandro Lucarella added a comment - OK, this is a real duplicate of JENKINS-26660 .

              People

              • Assignee:
                Unassigned
                Reporter:
                lucasocio Leandro Lucarella
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: