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

Re: [PATCH v3 2/5] stash: convert apply to builtin

From
Joel Teichroeb <joel@teichroeb.net>
Date
Mar 27, 2018, 16:20 UTC
Message-ID
<CA+CzEk8wUbV1mbcejyBuJ1fC87XvQPHWBNzF7qGQmLcDyytWyQ@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1803271744370.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>

On Tue, Mar 27, 2018 at 9:02 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 26 quoted lines
> Hi Joel,
>
> [...]
>> +
>> +static int do_apply_stash(const char *prefix, struct stash_info *info, int index)
>> +{
>> +     struct merge_options o;
>> +     struct object_id c_tree;
>> +     struct object_id index_tree;
>> +     const struct object_id *bases[1];
>> +     int bases_count = 1;
>> +     struct commit *result;
>> +     int ret;
>> +     int has_index = index;
>> +
>> +     read_cache_preload(NULL);
>> +     if (refresh_cache(REFRESH_QUIET))
>> +             return -1;
>> +
>> +     if (write_cache_as_tree(&c_tree, 0, NULL) || reset_tree(&c_tree, 0, 0))
>
> When applied on top of current `master`, I need to replace the &c_tree by
> c_tree.hash.
>
> Likewise...
>

I based this revision off next because of the object_id changes. I probably should have mentioned in my cover-letter.

Show 7 quoted lines
>> [...]
>> +
>> +     index_file = get_index_file();
>> +     xsnprintf(stash_index_path, PATH_MAX, "%s.stash.%d", index_file, pid);
>
> Since `pid_t` is `unsigned long long` on Windows, I changed the %d" to
> %"PRIuMAX and cast `pid` to `(uintmax_t)`.
Thanks for testing on windows! I'll have that fixed in the next revision.
Previous: Johannes SchindelinNext: Joel Teichroeb
Message 6 of 10 in “Convert some stash functionality to a builtin”
  1. 0/5 Convert some stash functionality to a builtinJoel Teichroeb, Mar 27, 2018
  2. 1/5 stash: improve option parsing test coverageJoel Teichroeb, Mar 27, 2018
  3. 2/5 stash: convert apply to builtinJoel Teichroeb, Mar 27, 2018
  4. Johannes SchindelinMar 27, 2018
  5. Johannes SchindelinMar 27, 2018
  6. Joel TeichroebMar 27, 2018
  7. 3/5 stash: convert drop and clear to builtinJoel Teichroeb, Mar 27, 2018
  8. 4/5 stash: convert branch to builtinJoel Teichroeb, Mar 27, 2018
  9. 5/5 stash: convert pop to builtinJoel Teichroeb, Mar 27, 2018
  10. Johannes SchindelinMar 27, 2018

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.