Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14306906
D21041.id50120.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21041.id50120.diff
View Options
diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php
--- a/src/workflow/ArcanistDiffWorkflow.php
+++ b/src/workflow/ArcanistDiffWorkflow.php
@@ -2882,8 +2882,8 @@
$commit = $api->getHeadCommit();
$prefix = idx($staging, 'prefix', 'phabricator');
- $base_tag = "refs/tags/{$prefix}/base/{$id}";
- $diff_tag = "refs/tags/{$prefix}/diff/{$id}";
+ $base_tag = "refs/heads/{$prefix}/base/{$id}";
+ $diff_tag = "refs/heads/{$prefix}/diff/{$id}";
$this->writeOkay(
pht('PUSH STAGING'),
@@ -2900,6 +2900,49 @@
'uri' => $staging_uri,
);
+ // Make a consistent name go that `git lfs` will cache which files need
+ // pushing and not just walk the whole directory. As recommend in:
+ // https://github.com/git-lfs/git-lfs/issues/4076
+ $staging_remote = 'phabriactor-staging';
+ $err = phutil_passthru(
+ 'git remote add %s %s',
+ $staging_remote,
+ $staging_uri);
+ if ($err) {
+ $err = phutil_passthru(
+ 'git remote remove %s',
+ $staging_remote);
+ if ($err) {
+ $this->writeWarn(
+ pht('STAGING FAILED'),
+ pht('Unable to remove %s remote branch.',
+ $staging_remote));
+ return self::STAGING_CLIENT_UNSUPPORTED;
+ } else {
+ $err = phutil_passthru(
+ 'git remote add %s %s',
+ $staging_remote,
+ $staging_uri);
+ if ($err) {
+ $this->writeWarn(
+ pht('STAGING FAILED'),
+ pht('Unable to add %s remote branch. Does it already exist?',
+ $staging_remote));
+ return self::STAGING_CLIENT_UNSUPPORTED;
+ }
+ }
+ }
+
+ list($err, $stdout, $stderr) = exec_manual('git fetch %s', $staging_remote);
+ if ($err) {
+ $this->writeWarn(
+ pht('STAGING FAILED'),
+ pht('Unable to fetch %s.', $staging_remote));
+ return self::STAGING_CLIENT_UNSUPPORTED;
+ }
+
+ $push_flags[] = $staging_remote;
+
// If the base commit is a real commit, we're going to push it. We don't
// use this, but pushing it to a ref reduces the amount of redundant work
// that Git does on later pushes by helping it figure out that the remote
@@ -2933,9 +2976,8 @@
}
$err = phutil_passthru(
- 'git push %Ls -- %s %Ls',
+ 'git push %Ls -- %Ls',
$push_flags,
- $staging_uri,
$ref_list);
if ($err) {
@@ -2949,6 +2991,10 @@
'use --skip-staging to skip this step.'));
}
+ phutil_passthru(
+ 'git remote remove %s',
+ $staging_remote);
+
return $refs;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 18, 10:49 PM (17 h, 51 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6904775
Default Alt Text
D21041.id50120.diff (2 KB)
Attached To
Mode
D21041: Use a named remote and branches for staging to help git-lfs
Attached
Detach File
Event Timeline
Log In to Comment