From: Alexander Shpilkin <ashpilkin@gmail.com>
To: git@vger.kernel.org
Subject: A cross between 'git stash create' and 'git stash push --include-untracked'?
Date: Sun, 30 Mar 2025 17:37:42 +0300 [thread overview]
Message-ID: <d8f596cfac9b001350b8b5e408067bb4caa073a7.camel@gmail.com> (raw)
Hi,
I'm trying to write a script for my use that would run before every
invocation of 'make' and record the working tree state at that point.
Stripping out the boring parts, it is basically just
git update-ref --create-reflog refs/build $(git stash create)
but the problem is that what I want is less like 'git stash create' and
more like 'git stash create --include-untracked', in case there are any
new and as yet untracked source files that are nevertheless picked up
by the build system.
Of course, that does not exist and, because of the syntax of 'git stash
create', cannot exist. I've looked at the code in builtin/stash.c and
it looks like there are only two callers of do_create_stash(): one is
create_stash() and hardcodes the include_untracked argument to zero,
the other is do_push_stash() and (assuming I try to undo its effects
with 'git stash pop' afterwards) will potentially destroy my working
tree's mtimes and cause more rebuilding than necessary. So it seems
like I'm stuck here.
Any suggestions?
--
Thanks,
Alex
next reply other threads:[~2025-03-30 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-30 14:37 Alexander Shpilkin [this message]
2025-03-31 7:47 ` A cross between 'git stash create' and 'git stash push --include-untracked'? Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8f596cfac9b001350b8b5e408067bb4caa073a7.camel@gmail.com \
--to=ashpilkin@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).