Stashes are currently stored using the reflog in a given repository. This is an interesting and novel way to handle them, but there is no way to easily move a stash across machines. For example, stashes cannot be bundled, pushed, or fetched. Let's solve this problem by allowing users to import and export stashes to a chain of commits. The commits used in a stash export contain two parents: one which is the pointer to the next exported stash (or to an empty commit with no parents if there are no more) and the second is the stash commit that would normally be stored in the reflog. We now produce completely reproducible exports by creating the base commit with predictable author and committer names and timestamps. The timestamp is arbitrary but picked to be the same as the one used by format-patch. We also now avoid size_t. Because of the constraints of portability, we can't have nice things like %zu, so now we use int. Parties wanting to import or export more than 2 billion stashes are welcome to send a patch improving the situation. While I have many stashes, I'm at least a billion or so away from that point, so I'm going to punt that to a future series. Changes from v1: * Change storage format as suggested by Junio. * Rename to GIT_OID_GENTLY. * Remove unnecessary initializations. * Use ALLOC_GROW_BY. * Ensure completely reproducible exports. * Avoid size_t. * Various other code cleanups. brian m. carlson (4): object-name: make get_oid quietly return an error builtin/stash: factor out revision parsing into a function builtin/stash: provide a way to export stashes to a ref builtin/stash: provide a way to import stashes from a ref Documentation/git-stash.txt | 29 +++- builtin/stash.c | 324 ++++++++++++++++++++++++++++++++++-- cache.h | 1 + object-name.c | 6 +- t/t3903-stash.sh | 52 ++++++ 5 files changed, 397 insertions(+), 15 deletions(-)