Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/6] devtool: use -f and don't use --exclude-standard when adding files to workspace
@ 2020-05-29 22:03 Martin Jansa
  2020-05-29 22:03 ` [PATCH 2/6] meta-selftest: add test of .gitignore in tarball Martin Jansa
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Martin Jansa @ 2020-05-29 22:03 UTC (permalink / raw)
  To: openembedded-core; +Cc: Martin Jansa

* I see a case where a tarball contains .gitignore and bunch of files
  which are normally ignored in git, but still included in the tarball
  (e.g. configure script next to configure.ac)
* when devtool is creating a git repo in workspace it won't include these
  files from tarball in the initial devtool-base commit, because
  git ls-files won't list them
* but then the first .patch file (without git headers) when applied with
  GitApplyTree._applypatch() will add all these still ignored files to a
  commit which used to only modify some files, because it's using -f:
      # Add all files
      shellcmd = ["git", "add", "-f", "-A", "."]
      output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
  at least in this case it would be better to add all ignored files in
  the initial devtool-base commit and then --force-patch-refresh will just
  include the small modification as before instead of adding unrelated
  files, just because they were initially ignored - this behavior will
  also match with the do_patch task in the actual build where the
  .gitignore is ignored when unpacking some tarball
* my use-case is fixed in setup_git_repo, but similar function is in
  devtool upgrade, I've changed it there as well

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 scripts/lib/devtool/__init__.py | 2 +-
 scripts/lib/devtool/upgrade.py  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index d39c474fbd..6ebe368a9e 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -196,7 +196,7 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
     if not os.path.exists(os.path.join(repodir, '.git')):
         bb.process.run('git init', cwd=repodir)
         bb.process.run('git config --local gc.autodetach 0', cwd=repodir)
-        bb.process.run('git add .', cwd=repodir)
+        bb.process.run('git add -f -A .', cwd=repodir)
         commit_cmd = ['git']
         oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d)
         commit_cmd += ['commit', '-q']
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index f962a71e41..ebe72282bb 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -235,14 +235,14 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
         # Copy in new ones
         _copy_source_code(tmpsrctree, srctree)
 
-        (stdout,_) = __run('git ls-files --modified --others --exclude-standard')
+        (stdout,_) = __run('git ls-files --modified --others')
         filelist = stdout.splitlines()
         pbar = bb.ui.knotty.BBProgress('Adding changed files', len(filelist))
         pbar.start()
         batchsize = 100
         for i in range(0, len(filelist), batchsize):
             batch = filelist[i:i+batchsize]
-            __run('git add -A %s' % ' '.join(['"%s"' % item for item in batch]))
+            __run('git add -f -A %s' % ' '.join(['"%s"' % item for item in batch]))
             pbar.update(i)
         pbar.finish()
 
-- 
2.25.1


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

end of thread, other threads:[~2020-05-29 22:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-29 22:03 [PATCH 1/6] devtool: use -f and don't use --exclude-standard when adding files to workspace Martin Jansa
2020-05-29 22:03 ` [PATCH 2/6] meta-selftest: add test of .gitignore in tarball Martin Jansa
2020-05-29 22:03 ` [PATCH 3/6] lib/oe/patch: prevent applying patches without any subject Martin Jansa
2020-05-29 22:03 ` [PATCH 4/6] lib/oe/patch: GitApplyTree: save 1 echo in commit-msg hook Martin Jansa
2020-05-29 22:03 ` [PATCH 5/6] Revert "lib/oe/patch: fix handling of patches with no header" Martin Jansa
2020-05-29 22:03 ` [PATCH 6/6] meta-selftest: add test for .patch file with long filename and without subject Martin Jansa
2020-05-29 22:32 ` ✗ patchtest: failure for "devtool: use -f and don't use ..." and 5 more Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox