git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] Importing and exporting stashes to refs
@ 2025-05-08 23:44 brian m. carlson
  2025-05-08 23:44 ` [PATCH v5 1/4] object-name: make get_oid quietly return an error brian m. carlson
                   ` (7 more replies)
  0 siblings, 8 replies; 72+ messages in thread
From: brian m. carlson @ 2025-05-08 23:44 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Phillip Wood

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.

Original thread at message-ID: <20220310173236.4165310-1-sandals@crustytoothpaste.net>

Changes from v4:
* Fix another use of oid_array.
* Fix various memory leaks.
* Fix a segfault which appeared after a rebase.
* Use strstr for commits since we don't need to worry about NUL.
* Added some additional tests.
* Verify the ident values we're using to avoid using bad values.
* Various other code cleanups.
* Rebase on `master`.

Changes from v3:
* Fix strbuf handling to avoid leaks and generally be more sensible.
* Make use of the error return code more often.
* Use oid_array.
* Tidy various parts of the code and fix long lines.
* Simplify tests using git tag.
* Shorten and tidy tests.
* Add an additional test covering the base commit OID and importing and
  exporting empty stashes.

Changes from v2:
* Fix uninitialized strbuf.
* Avoid C99-style initializations.

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.adoc |  29 ++-
 builtin/stash.c              | 339 +++++++++++++++++++++++++++++++++--
 hash.h                       |   1 +
 object-name.c                |   6 +-
 t/t3903-stash.sh             |  78 ++++++++
 5 files changed, 440 insertions(+), 13 deletions(-)


^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2025-06-25 16:30 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 23:44 [PATCH v5 0/4] Importing and exporting stashes to refs brian m. carlson
2025-05-08 23:44 ` [PATCH v5 1/4] object-name: make get_oid quietly return an error brian m. carlson
2025-05-09  1:55   ` Junio C Hamano
2025-05-09 19:50     ` brian m. carlson
2025-05-08 23:44 ` [PATCH v5 2/4] builtin/stash: factor out revision parsing into a function brian m. carlson
2025-05-09 15:27   ` Junio C Hamano
2025-05-08 23:44 ` [PATCH v5 3/4] builtin/stash: provide a way to export stashes to a ref brian m. carlson
2025-05-09 16:38   ` Junio C Hamano
2025-05-09 19:31   ` Junio C Hamano
2025-05-10 21:24   ` Jeff King
2025-05-12  9:10   ` Phillip Wood
2025-05-12 15:53     ` Junio C Hamano
2025-05-08 23:44 ` [PATCH v5 4/4] builtin/stash: provide a way to import stashes from " brian m. carlson
2025-05-09 19:54   ` Junio C Hamano
2025-05-11 23:44     ` brian m. carlson
2025-05-10 17:21   ` Jeff King
2025-05-12 12:42     ` Junio C Hamano
2025-05-12 12:58       ` Jeff King
2025-05-12 16:05         ` Junio C Hamano
2025-05-12 21:19     ` brian m. carlson
2025-05-10 21:33   ` Jeff King
2025-05-12  9:10   ` Phillip Wood
2025-05-09  1:10 ` [PATCH v5 0/4] Importing and exporting stashes to refs Junio C Hamano
2025-05-09 20:16   ` brian m. carlson
2025-05-09 16:53 ` D. Ben Knoble
2025-05-09 20:15   ` brian m. carlson
2025-05-10 19:13     ` D. Ben Knoble
2025-05-22 18:55 ` [PATCH] Makefile: avoid constant rebuilds with compilation database brian m. carlson
2025-05-22 18:55   ` [PATCH v6 0/5] Importing and exporting stashes to refs brian m. carlson
2025-06-01 22:32     ` [PATCH v7 0/4] " brian m. carlson
2025-06-01 22:32       ` [PATCH v7 1/4] object-name: make get_oid quietly return an error brian m. carlson
2025-06-01 22:32       ` [PATCH v7 2/4] builtin/stash: factor out revision parsing into a function brian m. carlson
2025-06-01 22:32       ` [PATCH v7 3/4] builtin/stash: provide a way to export stashes to a ref brian m. carlson
2025-06-05  9:25         ` Phillip Wood
2025-06-11 11:31         ` Kristoffer Haugsbakk
2025-06-11 23:35           ` brian m. carlson
2025-06-01 22:32       ` [PATCH v7 4/4] builtin/stash: provide a way to import stashes from " brian m. carlson
2025-06-05  9:38       ` [PATCH v7 0/4] Importing and exporting stashes to refs Phillip Wood
2025-06-12  1:12       ` [PATCH v8 " brian m. carlson
2025-06-12  1:12         ` [PATCH v8 1/4] object-name: make get_oid quietly return an error brian m. carlson
2025-06-12  1:12         ` [PATCH v8 2/4] builtin/stash: factor out revision parsing into a function brian m. carlson
2025-06-12  1:12         ` [PATCH v8 3/4] builtin/stash: provide a way to export stashes to a ref brian m. carlson
2025-06-12  1:12         ` [PATCH v8 4/4] builtin/stash: provide a way to import stashes from " brian m. carlson
2025-06-25  8:40         ` [PATCH v8 0/4] Importing and exporting stashes to refs Phillip Wood
2025-06-25 16:30           ` Junio C Hamano
2025-05-22 18:55   ` [PATCH v6 1/5] object-name: make get_oid quietly return an error brian m. carlson
2025-05-22 19:27     ` Junio C Hamano
2025-05-22 18:55   ` [PATCH v6 2/5] reflog-walk: expose read_complete_reflog brian m. carlson
2025-05-22 21:53     ` Ramsay Jones
2025-05-23 23:22       ` brian m. carlson
2025-05-24  1:09         ` Ramsay Jones
2025-05-26 19:55           ` brian m. carlson
2025-05-29 16:01     ` Phillip Wood
2025-05-29 21:59       ` Junio C Hamano
2025-05-22 18:55   ` [PATCH v6 3/5] builtin/stash: factor out revision parsing into a function brian m. carlson
2025-05-22 20:34     ` Junio C Hamano
2025-05-23 23:25       ` brian m. carlson
2025-05-24  0:23         ` Junio C Hamano
2025-05-26 19:36           ` brian m. carlson
2025-05-22 18:55   ` [PATCH v6 4/5] builtin/stash: provide a way to export stashes to a ref brian m. carlson
2025-05-22 20:51     ` Junio C Hamano
2025-05-26 19:42       ` brian m. carlson
2025-05-29 16:01     ` Phillip Wood
2025-05-22 18:55   ` [PATCH v6 5/5] builtin/stash: provide a way to import stashes from " brian m. carlson
2025-05-22 21:09     ` Junio C Hamano
2025-05-26 20:03       ` brian m. carlson
2025-05-22 21:15     ` Junio C Hamano
2025-05-23 13:17       ` Phillip Wood
2025-05-22 19:00   ` [PATCH] Makefile: avoid constant rebuilds with compilation database brian m. carlson
2025-05-22 19:08     ` Junio C Hamano
2025-06-11 11:35 ` [PATCH v5 0/4] Importing and exporting stashes to refs Kristoffer Haugsbakk
2025-06-12  0:45   ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).