git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [feature suggestion] Add 'git stash export', 'git stash import' commands to allow to backup stash externally

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 6, 2021, 08:40 UTC
Message-ID
<6093ab6bd3ea8_24e620862@natae.notmuch>
In-Reply-To
<d4ae27b9-3911-506c-a23c-3ed91bb250d1@rawbw.com>
Yuri wrote:
Show 6 quoted lines
> On 5/5/21 11:43 PM, Johannes Sixt wrote:
> > I know. But, as I said, when you turn away from your current work, which
> > is precious, then you should make a commit, in particular, when you can
> > forsee that you might not be able to come back soon.
> 
> How can I commit unfinished work?
Just like that: `git commit`.
That's what you are doing anyway, whether you realize or not.
> Commits are public, this would break things.

No. Commits are most definitely not public. Not unless you do `git push`, and only if you push to a public repository.

I have countless commits on local branches that nobody would every see. Many on a "tmp" branch.

I also have many private repositories, which contain passwords and other sensitive information. Again... Only for my eyes.

> > For long-term storage, use branches.
> 
> Branches are too heavy-weight.
No, each one is a single file consisting of 41 bytes.
A single stash takes about 200 bytes. Considerably more.
Compare:
 * .git/refs/heads/master
 * .git/logs/refs/stash
> They need merging. Sometimes several stash items need to be used
> together, which makes it inconvenient.
You mean like one stash item goes on top of another?
Like... Commits on a branch?

I think this boils down to a confussion of concepts. Stash items are commits. The only real conceptual difference is that you did not specify the message (-m tmp would do that trick).

Again. Check yourself; the commit is there:
 * git cat-file -p stash@{0}
 * git cat-file -p master
Cheers.
-- 
Felipe Contreras
Previous: Felipe ContrerasNext: Yuri
Message 13 of 16 in “[feature suggestion] Add 'git stash export', 'git stash import' commands to allow to backup stash externally”
  1. YuriMay 5, 2021
  2. Randall S. BeckerMay 5, 2021
  3. YuriMay 5, 2021
  4. Junio C HamanoMay 6, 2021
  5. Johannes SixtMay 6, 2021
  6. YuriMay 6, 2021
  7. Johannes SixtMay 6, 2021
  8. YuriMay 6, 2021
  9. Junio C HamanoMay 6, 2021
  10. YuriMay 6, 2021
  11. Junio C HamanoMay 6, 2021
  12. Felipe ContrerasMay 6, 2021
  13. Felipe ContrerasMay 6, 2021
  14. YuriMay 6, 2021
  15. Felipe ContrerasMay 6, 2021
  16. Theodore Ts'oMay 6, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.