From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/git/
Date: Sun, 30 Oct 2016 21:23:42 +0000 (UTC) [thread overview]
Message-ID: <1477862610.f77fcd6b0b4ebb49ca62f5767cd5c931127c3dbb.mgorny@gentoo> (raw)
commit: f77fcd6b0b4ebb49ca62f5767cd5c931127c3dbb
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 30 19:14:11 2016 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 21:23:30 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f77fcd6b
[sync] Run `git update-index --refresh` when doing shallow pulls
Run `git update-index --refresh` to force proper index recheck before
running `git reset --merge` on a shallow pull. This fixes syncing on
some filesystem configurations including overlayfs on squashfs.
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
pym/portage/sync/modules/git/git.py | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
index 3734b80..dc94ec9 100644
--- a/pym/portage/sync/modules/git/git.py
+++ b/pym/portage/sync/modules/git/git.py
@@ -89,7 +89,7 @@ class GitSync(NewBase):
else:
# Since the default merge strategy typically fails when
# the depth is not unlimited, use `git fetch` followed by
- # `git reset --merge`.
+ # `git update-index --refresh`, then `git reset --merge`.
try:
remote_branch = portage._unicode_decode(
subprocess.check_output([self.bin_command, 'rev-parse',
@@ -116,12 +116,23 @@ class GitSync(NewBase):
**self.spawn_kwargs)
if exitcode == os.EX_OK and self.repo.sync_depth is not None:
- reset_cmd = [self.bin_command, 'reset', '--merge', remote_branch]
- if quiet:
- reset_cmd.append('--quiet')
- exitcode = subprocess.call(reset_cmd,
+ # update-index --refresh is needed on some filesystems
+ # (e.g. with overlayfs on squashfs)
+ update_index_cmd = [self.bin_command, 'update-index']
+ if quiet: # -q needs to go first
+ update_index_cmd.append('-q')
+ update_index_cmd.append('--refresh')
+
+ exitcode = subprocess.call(update_index_cmd,
cwd=portage._unicode_encode(self.repo.location))
+ if exitcode == os.EX_OK:
+ reset_cmd = [self.bin_command, 'reset', '--merge', remote_branch]
+ if quiet:
+ reset_cmd.append('--quiet')
+ exitcode = subprocess.call(reset_cmd,
+ cwd=portage._unicode_encode(self.repo.location))
+
if exitcode != os.EX_OK:
msg = "!!! git pull error in %s" % self.repo.location
self.logger(self.xterm_titles, msg)
next reply other threads:[~2016-10-30 21:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-30 21:23 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-07-10 4:28 [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/git/ Zac Medico
2018-07-08 22:18 Zac Medico
2018-07-08 21:17 Zac Medico
2018-03-21 18:26 Zac Medico
2018-02-05 18:44 Michał Górny
2017-08-09 20:56 Zac Medico
2017-08-09 20:39 Zac Medico
2017-02-25 0:25 Zac Medico
2016-11-07 22:16 Zac Medico
2016-11-03 20:05 Zac Medico
2016-09-22 21:45 Zac Medico
2016-07-18 16:32 Zac Medico
2016-07-14 18:41 Zac Medico
2015-11-07 21:28 Zac Medico
2015-09-04 17:27 Brian Dolbec
2015-01-18 18:04 Michał Górny
2014-12-04 20:16 Brian Dolbec
2014-12-04 20:04 [gentoo-commits] proj/portage:plugin-sync " Brian Dolbec
2014-12-04 20:16 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2014-12-04 20:04 [gentoo-commits] proj/portage:plugin-sync " Brian Dolbec
2014-12-04 20:16 ` [gentoo-commits] proj/portage:master " Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1477862610.f77fcd6b0b4ebb49ca62f5767cd5c931127c3dbb.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox