Re: [PATCH v3 00/32] object-store: lookup_commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

> This continues the elimination of global variables in the object store and
> teaches lookup_commit[_reference] and alike to handle a_repository.
>
> This is also available as
> https://github.com/stefanbeller/git/tree/object-store-lookup-commit
> or applies on top of 02f70d63027 (Merge branch 'sb/object-store-grafts'
> into next, 2018-06-28).
>
> Picking a base for this one is really hard, as nearly all series currently
> cooking or in flight collide with it on one or two lines. (lookup_* is used
> heavily, who would have thought?)

One technique these (not just this) recent efforts seem to be
forgetting is to introduce "new" names that take a_repo and then
make the existing one a thin wrapper that calls the new one with
&the_repo as the argument.

IOW, a new call to lookup_commit_reference(oid) in a function that
is happy to access the default repo (and notice taht 99% of our code
is happy with using just the currrent repository the user started
the git process for) does not need to be updated to call the
function with the same name with a different function signature
lookup_commit_reference(the_repo, oid).  If we name the new one
lookup_commit_reference_in_repo(r, oid) and make the callers that
already take a repo pointer call it, while leaving the callers that
do not even know or care about multiple in-core repo instances alone
to keep calling lookup_commit_reference(oid), you do not have to
worry too much about colliding.  That way, you do not have to step
on each others' toes with avoidable semantic merge conflicts and
incrementally improve things over time, no?

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux