From: Joel Teichroeb <joel@teichroeb.net>
To: git@vger.kernel.org
Subject: [RFC] Converting git stash to a builtin
Date: Sat, 11 Mar 2017 12:25:57 -0800 [thread overview]
Message-ID: <CA+CzEk9-SDj9FTC_ucu9oBDOe59ce4Jz_OxZbYrDpmbUJHTpFg@mail.gmail.com> (raw)
I've been working on rewriting git stash as a c builtin and I have all
but three tests passing. I'm having a bit of trouble fixing them, as
well as a few other issues, so I'd really appreciate some help. Don't
bother commenting on the small details yet as I still need to go
though the code to make sure it matches the code style guidelines.
The commit is a bit big, so I'll just link to it on github.
https://github.com/klusark/git/commit/f74d65ae3e06d2c0ab000702ac5e756550e06454
Test Summary Report
-------------------
t7601-merge-pull-config.sh (Wstat: 256 Tests: 14
Failed: 2)
Failed tests: 11-12
Non-zero exit status: 1
t3903-stash.sh (Wstat: 256 Tests: 74
Failed: 1)
Failed test: 69
Non-zero exit status: 1
It looks to be the same issue for both of these cases where
merge-recursive reports:
error: Your local changes to the following files would be overwritten by merge:
file
other-file
which doesn't make sense as those files didn't exist before the merge.
Furthermore if I take the existing git stash implementation and have
it stop before running the merge-recursive command and then run it on
the commandline manually, I get the same issue. I've tried setting all
the same environment variables that the existing git stash
implementation does, but it doesn't help. It seems like there could be
a bug in merge-recursive, but I'm not sure how to track it down.
git stash uses the GIT_INDEX_FILE environment variable in order to not
trash the main index. I ended up doing things like this:
discard_cache();
ret = read_cache_from(index_path);
write_index_as_tree(orig_tree.hash, &the_index, index_path, 0, NULL);
discard_cache();
ret = read_cache_from(index_path);
in order to have an empty cache. Could someone take a look at my uses
of the index and point out better ways to do it?
My main goal right now is to cleanup the code and replace more of the
commands with native code.
Thanks,
Joel
reply other threads:[~2017-03-11 20:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CA+CzEk9-SDj9FTC_ucu9oBDOe59ce4Jz_OxZbYrDpmbUJHTpFg@mail.gmail.com \
--to=joel@teichroeb.net \
--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).