Hi Mark,

good feedback.  Haven't used "git clean" before.

I turned off "Clean after checkout" and do this before the actual build:

  ( set +x
    git clean -n -xfd \
    | grep -v ' \.repository/' \
    | while read f; do \
        p=${f#Would remove }
        (set -x; rm -rf $WORKSPACE/$p)
      done
  )
  rm -rf $WORKSPACE/.repository/org/myorg

That gives me what I want.

(Yes, I could have use some "| cut ... | xargs rm" pipe to achieve the same, but
I like the console output I get with my way.)

Regards,
-Max


On 02/13/2014 03:53 PM, Mark Waite wrote:
If the "Clean after checkout" option you are referencing is the option from the 
git plugin, then I would rather suggest that you should adapt and maintain some form of 
build specific clean within your maven pom.xml, rather than complicating the git plugin 
with inclusions and exclusions for the operation.

The "Clean after checkout" option in the git plugin is conceptually mapped to "git 
clean -xfd".  Your exclusion / inclusion proposal has no matching concept in the git command 
line nor in JGit.  I'd rather not see the git plugin stray from its conceptual mapping to git 
commands.  It is complicated enough already.

Mark Waite


On Thu, Feb 13, 2014 at 4:34 PM, Max Spring <m2spr...@springdot.org 
<mailto:m2spr...@springdot.org>> wrote:

    I'm using the "Clean after checkout" option a lot with my Gerrit 
verification Maven jobs.
    I also have these jobs use a local repository, sitting in the job's 
workspace.

    Because of the "Clean after checkout" option set, the job's local 
repository gets wiped and
    the subsequent build has to time-consumingly repopulate it with lots of 
artifacts.

    I'd like to speed this up.

    Ideally, I'd like to exclude certain directories/files from being removed when using 
the "Clean after checkout" option is set.
    Sort of: "exclude=$WORKSPACE/.__repository"

    In addition to an exclude option for "Clean after checkout",
    I would like to have an include option, where I would then specify
    certain hierarchies within the private local repository to be cleaned,
    like "include=$WORKSPACE/.__repository/org/myorg/".

    -Max

    --
    You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscribe@__googlegroups.com 
<mailto:jenkinsci-users%2bunsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/__groups/opt_out 
<https://groups.google.com/groups/opt_out>.




--
Thanks!
Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to