All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH] build_clone: git clean newly cloned trees
@ 2015-10-29 15:57 Ian Jackson
  2015-10-29 16:01 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2015-10-29 15:57 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Ian Jackson, Ian Campbell

This may seem redundant, however:

git does not track empty directories.  So it can happen that a
directory is created as part of `git clone', but is empty in the
revision switched to with `git checkout'.

In this situation, the tree we are going to build ought not to contain
this directory, because that directory will not (in general) be
produced, eg when the revision being switched to becomes master.

We can use git clean to produce a working tree whose contents -
including the presence or absence of empty directories - depends only
on the commit we are trying to check out, and not on the previous
states of the git history or working tree.

For example, if a directory is made empty (ie, deleted, since git does
not distinguish) in xen.git#staging, osstest's clones of
xen.git#master will produce the directory, but `git checkout' of
staging won't delete it.  If the xen.git build system mistakenly
depends on this directory, we won't detect this until the deletion
reaches master.  This situation actually occurred with xen.git#598e97f
"tools/python: remove broken xl binding" (fixed in b261366f).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
---
 Osstest/TestSupport.pm |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index f9eba6b..aa41952 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1231,6 +1231,7 @@ END
 END
                          (length($r{"revision_$which"}) ? <<END : ''));
 	    git checkout '$r{"revision_$which"}'
+	    git clean -xdf
 END
     } else {
         die "$vcs $which $tree ?";
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-02 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29 15:57 [OSSTEST PATCH] build_clone: git clean newly cloned trees Ian Jackson
2015-10-29 16:01 ` Andrew Cooper
2015-11-02 14:19   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.