Skip to content

handle discarding submodule changes properly - #3728

Merged
iAmWillShepherd merged 18 commits into
masterfrom
dont-remove-submodules
Jan 11, 2018
Merged

iAmWillShepherd merged 18 commits into
masterfrom
dont-remove-submodules

Conversation

@shiftkey

@shiftkey shiftkey commented Jan 5, 2018 •

Copy link
Copy Markdown
Member

Fixes #3647

  • don't move a submodule to the trash
  • git checkout -- [path] doesn't work on submodules, gotta do git submodule update -- [path] to undo changes
  • add tests against real repositories
    • listing submodules
    • update submodule to undo change

@shiftkey shiftkey changed the title handle discarding submodules properly handle discarding submodule changes properly Jan 5, 2018
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 9, 2018
@iAmWillShepherd iAmWillShepherd self-assigned this Jan 9, 2018
@iAmWillShepherd

Copy link
Copy Markdown
Contributor

Given how big this is, it may take me a few hours to get this reviewed. I'll likely ping you with questions as they come up.

@shiftkey

Copy link
Copy Markdown
Member Author

@iAmWillShepherd the app/test/fixtures/submodule-basic-setup folder (a new repository to aid with testing) is inflating the diff, but take your time

Comment thread app/src/lib/git/submodule.ts Outdated
//
// https://git-scm.com/docs/git-describe

const [path, describeOutput] = rest

This comment was marked as spam.

Comment thread app/src/lib/stores/git-store.ts Outdated

await queueWorkHigh(files, async file => {
if (file.status !== AppFileStatus.Deleted) {
const foundSubmodule = submodules.find(s => s.path === file.path)

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member Author

🍎

@iAmWillShepherd
iAmWillShepherd merged commit 6f6cd1a into master Jan 11, 2018
@iAmWillShepherd
iAmWillShepherd deleted the dont-remove-submodules branch January 11, 2018 17:25
@say25

say25 commented May 3, 2018

Copy link
Copy Markdown
Member

Don't mean to ruin this but I think this doesn't work anymore. I modified the gemoji library in Github Desktop and attempted to discard changes. It failed.

2018-05-03.desktop.beta.log

@shiftkey

shiftkey commented May 3, 2018 •

Copy link
Copy Markdown
Member Author

@say25 can you open a fresh issue with details to reproduce it? This error isn't once I've seen before:

2018-05-03T05:41:28.688Z - error: [ui] `git submodule status --` exited with an unexpected code: 139.
 fe965f16f6f690d40a738e75a46fad3f41f5daa3 app/static/common/choosealicense.com (fe965f1)
 690a433b668348c33087d34fafe2155ebe8bb4cf app/static/common/gitignore (remotes/origin/reduce-noise-1009-g690a433)

/Applications/GitHub Desktop.app/Contents/Resources/app/git/libexec/git-core/git-submodule: line 979: 12490 Segmentation fault: 11  git ${wt_prefix:+-C "$wt_prefix"} ${prefix:+--super-prefix "$prefix"} submodule--helper status ${GIT_QUIET:+--quiet} ${cached:+--cached} ${recursive:+--recursive} "$@"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants