[JIRA] [git-plugin] (JENKINS-29893) Allow exclusions for git clean

8 views
Skip to first unread message

sseidel@java.net (JIRA)

unread,
Aug 11, 2015, 9:36:01 AM8/11/15
to jenkinsc...@googlegroups.com
sseidel created an issue
 
Jenkins / Improvement JENKINS-29893
Allow exclusions for git clean
Issue Type: Improvement Improvement
Assignee: Nicolas De Loof
Components: git-plugin
Created: 11/Aug/15 1:35 PM
Priority: Minor Minor
Reporter: sseidel

I would like to suggest an option to allow exclusions for git clean. Currently, when "Clean workspace" is selected, "git clean -fdx" is run, which is a great way of starting with a pristine build directory. However, if for Maven projects a "Local to the workspace" M2 repository is selected, the clean command will also clean away the repository, which will cause hundreds of artifacts to be re-downloaded. Even though a maven proxy makes this les worse, it would be nice if there was an option to allow exclusions from the clean (git clean -fdx -e <pattern>).

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Aug 11, 2015, 10:21:38 AM8/11/15
to jenkinsc...@googlegroups.com
Mark Waite commented on Improvement JENKINS-29893
 
Re: Allow exclusions for git clean

If we implement exclusions for clean, we should also include implementing timeout for clean, since it would change the same part of the user interface.

bdominguez@virtualwaregroup.com (JIRA)

unread,
Oct 15, 2019, 7:44:03 PM10/15/19
to jenkinsc...@googlegroups.com

Any news? I would like to see "Clean before checkout" behaviour to have an option to add an exclude pattern:

 

https://git-scm.com/docs/git-clean

 

Now I'm executing the command myself without using this behaviour as it does not support it. Example: 'git clean -fdx -e MyFolderToExclude'

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 15, 2019, 9:14:02 PM10/15/19
to jenkinsc...@googlegroups.com

I have no plans currently to implement this in the plugin. It is simple to call the git clean command from Jenkins Pipeline and is not much more difficult to call it from Freestyle jobs.

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 15, 2019, 9:16:03 PM10/15/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Improvement JENKINS-29893
I have no plans currently to implement this in the plugin.  It is simple to call the {{git clean}} command from Jenkins Pipeline and is not much more difficult to call it from Freestyle jobs.


The {{git clean}} command does not require authentication, so does not need the added logic that the git plugin provides for authentication support.

bdominguez@virtualwaregroup.com (JIRA)

unread,
Oct 16, 2019, 8:47:03 AM10/16/19
to jenkinsc...@googlegroups.com

I know that. It's what I'm currently doing.

But it would be nice that we could do it in "Clean before checkout" behaviour on Jenkins UI because everywhere where we are calling "checkout scm" uses that configuration. In this case I need to make two lines in my Jenkinsfile. 1-"git clean", 2-"checkout scm". In pipelines that you have stash and unstash you need to copy this code everywhere.

eub.kansas19@gmail.com (JIRA)

unread,
Oct 30, 2019, 11:23:02 AM10/30/19
to jenkinsc...@googlegroups.com

+1 for the script/pipeline maintenance of modifying everywhere that uses 'checkout scm'

Reply all
Reply to author
Forward
0 new messages