git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [GSoC] [RFC] git stashing discussing solution approaches
@ 2019-04-09 11:50 Kapil Jain
  0 siblings, 0 replies; only message in thread
From: Kapil Jain @ 2019-04-09 11:50 UTC (permalink / raw)
  To: git, Thomas Gummerer, Johannes Schindelin, Duy Nguyen

Just had a small discussion on irc about solving
https://git.github.io/SoC-2019-Ideas/#teach-git-stash-to-handle-unmerged-index-entries
the discussion:
https://colabti.org/irclogger/irclogger_log/git-devel?date=2019-04-09

Below are two approaches for solving this problem:

Approach 1) The suggested approach.

Perform an octopus merge of all `stage n` (n>0) unmerged index entries.

a problem with this approach:

1) Octopus merge can fail, and if it does what do we do in that case ?
Solution: store the conflicted state, and restore it when stash is applied.

I am not clear on how would we store the conflicted state (away from
index file).
please provide reference to code or docs that may be helpful to
understand this or is this the part that needs to be implemented for
this project ?


Approach 2) This approach is a shot in dark; not well thought, may
have a lot of problems.

consider a scenario, index file has 20 entries, 5 of which are
unmerged. now you detach those 5 entries from index file and store
them in some other file say `index_unmerged_branch_name`. now index is
no longer unmerged, and user can now do `git stash push`.
later when user does `git stash apply` we put those 5 unmerged entries
back in the index file.

identified problems with this approach:

1) where do you store `index_unmerged_branch_name`? What if the user
has a file that's already named like that?
Solution: we store `index_unmerged_branch_name` in `.git` directory

2) how do you reference that to a specific stash commit? remember that
there can be multiple stashes.
Solution: we put that info in the `.git/log/refs/stash` file telling
it, that this particular stash has a separate
`index_unmerged_branch_name` file.
Although this would require changing format of log file and hence the
code logic to read it. but it could be done.

3) blobs that are referenced in this index may not be referenced by
any tree/commit anymore.
Solution: perhaps we can store the references too.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-09 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 11:50 [GSoC] [RFC] git stashing discussing solution approaches Kapil Jain

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).