Skip to content

commands: teach '--everything' to 'git lfs migrate'#2558

Merged
ttaylorr merged 1 commit intomasterfrom
migrate-everything
Sep 7, 2017
Merged

commands: teach '--everything' to 'git lfs migrate'#2558
ttaylorr merged 1 commit intomasterfrom
migrate-everything

Conversation

@ttaylorr
Copy link
Contributor

@ttaylorr ttaylorr commented Sep 7, 2017

This pull request teaches the --everything flag to the import and info modes of git-lfs-migrate(1).

--everything indicates that all local references should be migrated. In other words --everything means "migrate the entire section of my repository's local copy that is reachable by any reference". Practically, this means "migrate everything".

Previously, in order to do this, users had to do some combination of:

git show-ref --heads --tags \
  | cut -d ' ' -f 2 \
  | sed -e 's/^/--include-ref=/' \
  | xargs git lfs migrate import

which is correct, but not useable. The presence of --everything has the same practical effect as making the included refspec the output of git show-ref --heads --tags (via git.LocalRefs()).


/cc @git-lfs/core

@ttaylorr ttaylorr added the review label Sep 7, 2017
@ttaylorr ttaylorr added this to the v2.3.0 milestone Sep 7, 2017
@ttaylorr ttaylorr requested a review from rubyist September 7, 2017 17:53
@ttaylorr ttaylorr merged commit bec5f34 into master Sep 7, 2017
@ttaylorr ttaylorr deleted the migrate-everything branch September 7, 2017 20:38
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Apr 30, 2021
The last test in this file has been accidentally skipped since
it was added in commit c8c29f5
in PR git-lfs#2558, so we just ensure it runs by removing the early
exit call.
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request May 1, 2021
The last test in this file has been accidentally skipped since
it was added in commit c8c29f5
in PR git-lfs#2558, so we just ensure it runs by removing the early
exit call.

We also change one use of "wc -l" to "wc -c" to ensure we are
indeed checking that the command outputs nothing; otherwise,
if it happened to output one line, the "echo -n" would remove
the trailing newline and "wc -l" would report zero.
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request May 2, 2021
The last test in this file has been accidentally skipped since
it was added in commit c8c29f5
in PR git-lfs#2558, so we just ensure it runs by removing the early
exit call.

We also change one use of "wc -l" to "wc -c" to ensure we are
indeed checking that the command outputs nothing; otherwise,
if it happened to output one line, the "echo -n" would remove
the trailing newline and "wc -l" would report zero.
pcal43 pushed a commit to pcal43/git-lfs-hack that referenced this pull request Jul 22, 2021
The last test in this file has been accidentally skipped since
it was added in commit c8c29f5
in PR git-lfs#2558, so we just ensure it runs by removing the early
exit call.

We also change one use of "wc -l" to "wc -c" to ensure we are
indeed checking that the command outputs nothing; otherwise,
if it happened to output one line, the "echo -n" would remove
the trailing newline and "wc -l" would report zero.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants