aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-06-12 01:12:20 +0000
committerJunio C Hamano <gitster@pobox.com>2025-06-12 13:32:18 -0700
commitbc303718cc288b54233b204ce88223a16fb38487 (patch)
tree53738bfb5b1cad2c27e17f1a78819ddad9ace5b4 /builtin/diff.c
parentbuiltin/stash: provide a way to export stashes to a ref (diff)
downloadgit-bc303718cc288b54233b204ce88223a16fb38487.tar.gz
git-bc303718cc288b54233b204ce88223a16fb38487.zip
builtin/stash: provide a way to import stashes from a ref
Now that we have a way to export stashes to a ref, let's provide a way to import them from such a ref back to the stash. This works much the way the export code does, except that we strip off the first parent chain commit and then store each resulting commit back to the stash. We don't clear the stash first and instead add the specified stashes to the top of the stash. This is because users may want to export just a few stashes, such as to share a small amount of work in progress with a colleague, and it would be undesirable for the receiving user to lose all of their data. For users who do want to replace the stash, it's easy to do to: simply run "git stash clear" first. We specifically rely on the fact that we'll produce identical stash commits on both sides in our tests. This provides a cheap, straightforward check for our tests and also makes it easy for users to see if they already have the same data in both repositories. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff.c')
0 files changed, 0 insertions, 0 deletions