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

Re: "Branch objects" (was: Re: cherry picking and merge)

From
NWNico Williams <nico@cryptonector.com>
Date
Aug 6, 2014, 20:07 UTC
Message-ID
<20140806200726.GE23449@localhost>
In-Reply-To
<CANQwDwcHSO+KwhZbo4BTcWnAWGWbJzNQ7CY2m3nq+p0t9uDeqg@mail.gmail.com>
On Wed, Aug 06, 2014 at 08:31:18PM +0200, Jakub Narębski wrote:
Show 10 quoted lines
> On Wed, Aug 6, 2014 at 6:26 PM, Nico Williams <nico@cryptonector.com> wrote:
> > My proposal was to put this sort of ancillary history info in a
> > "branch object" (and that branches should be objects).  This would
> > have a number of benefits, not the least of which is that at push time
> > you can drop such ancillary history without having to alter the
> > commits being pushed.
> 
> Is it something like object-ified reflog, similar to how replacement
> objects (git-replace) can be thought to be object-ified grafts (I know
> they are more)? Do I understand it correctly?

Yes, per-branch. At push time a commit would be pushed to the upstream branch listing the commits pushed now (and who by). Locally every rebase/cherry-pick/merge/commit onto the branch would appear in the branch object's history, kinda just like the reflog. The main difference is that the upstream branch's history could be viewed.

Show 5 quoted lines
> Did you plan to (ab)use known object types: tree and commit (a bit
> similar to git-replace and git-note object, though there is no need for
> fanout trees - the top level tree can reproduce refs hierarchy)? I see
> that you planned to (ab)use existing transfer mechanism of refs and
> objects...
Just like signed tags, basically.
Show 5 quoted lines
> > Reverts upstream?  The revert should record the commit hash of the
> > commit it reverts (but file-level reverts lose), so that this could be
> > noticed.
> 
> If it is object-ified reflog then reverts are not a problem...
Right.
Show 8 quoted lines
> > Rebases upstream?  Well, that shouldn't happen, but if it does then
> > you must rebase --onto and any cherry-picks of upstream rebased
> > commits lose their ties to those (but this can be detected).
> 
> With rebases the problem is that it would be nice to have (at least
> for a short time) the history of series of patches (the metahistory,
> or history of a branch), but usually one doesn't need old pre-rebase
> version after cleaning up the history for publishing.
Right.
Show 5 quoted lines
> > In general recording more metadata (assuming there's not privacy
> > issues to consider) can't hurt.  Using it might, but having the option
> > to can also help.
> 
> True...

The principle should be to record as much metadata as possible, pruning ancillary metadata (reflog-like metadata that isn't on the commits) only at push time.

Nico
Previous: Jakub NarębskiNext: Tony Finch
Message 2 of 9 in “"Branch objects" (was: Re: cherry picking and merge)”
  1. Jakub NarębskiAug 6, 2014
  2. Nico WilliamsAug 6, 2014
  3. Tony FinchAug 7, 2014
  4. Nico WilliamsAug 7, 2014
  5. Tony FinchAug 7, 2014
  6. Nico WilliamsAug 7, 2014
  7. Tony FinchAug 7, 2014
  8. Nico WilliamsAug 7, 2014
  9. Nico WilliamsAug 7, 2014

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.