git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: phillip.wood123@gmail.com,
	 Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,  Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH 3/4] merge options: add a conflict style member
Date: Fri, 8 Mar 2024 20:33:00 -0800	[thread overview]
Message-ID: <CABPp-BFBNDkdL5Z-VOrv2Z3aWaA3OpWFqd6ZGmU9YC8jBRsAog@mail.gmail.com> (raw)
In-Reply-To: <xmqqwmqcfz4y.fsf@gitster.g>

On Fri, Mar 8, 2024 at 8:48 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> phillip.wood123@gmail.com writes:
>
> > I agree it is confusing, Elijah renamed it from ll-merge.c relatively
> > recently 6723899932e (merge-ll: rename from ll-merge, 2023-05-16). It
> > looks like the idea was to group it with the other merge* files:
>
> That reasoning cuts both ways.  When you are only interested in the
> upper level API functions, being able to skip ll-anything as "low
> level details" is a powerful thing.  merge-ll & hash-ll separated
> far apart will make it impossible.

merge-ll is wildly different than every other *-ll.h file we have in
the tree; the latter set of files may be misnamed, for reasons other
than what you are suggesting here.  hash-ll, hex-ll, etc. exist due to
the main include file having some rarely used API that require more
#include statements, and most users of e.g. hex functions can get away
with just including hex-ll.h rather than the full hex.h.  Thus,
hex-ll.h is _not_ "low level details that you can skip", but "the
_primary_ data structures and functions".  It doesn't get the name
hex.h, though, because if we did that then the folks that need both
primary parts of the API and the occasional additional function would
need to have two hex-related includes.  Also, every function declared
within hex-ll.h is still defined within hex.c; there is no separate
hex-ll.c file, and the same is true of all the other *-ll.h files
other than merge-ll.h.  As such, there is absolutely no relation
between hex-ll.h, hash-ll.h, fsmonitor-ll.h, etc.  Using an ll- prefix
on those filenames thus makes no sense to me.  (It's not clear that
-ll even makes sense as a suffix for these files either, but it's not
clear what else to use instead.  If I recall correctly I originally
put forward "-basics" as a possible name suffix for these files, but
someone else suggested "-ll", and not having any better ideas or
strong opinions I just went with it.)

merge-ll is different in that it is actually a separate level of the
API, and there are both a merge-ll.h file and a merge-ll.c file.

I originally had proposed only adding the hex-ll.h, hash-ll.h,
fsmonitor-ll.h, etc. files, but you suggested that ll-merge should
either be renamed or that these new files should be
(https://lore.kernel.org/git/CABPp-BErrVUnuDjL73edDpmkKUvs6Ny6cYwvueXw1toB4JcF-Q@mail.gmail.com/).


Now, all that said, and assuming we were to go back to a world where
the other *-ll.h files don't exist (or are renamed independently with
a different suffix), I'm still not understanding why ll-merge makes
more sense to you and Phillip than merge-ll.  Could you explain more?
If you're only interested in the upper-level API functions, that
suggests you are already at the function level and looking within a
given file.  The low-level functions are already split out into a
separate file, so you just don't go looking at that separate file.
However, if you're interested in "where in this codebase do I find the
stuff related to merging", then you aren't in a file but in a
directory listing.  The first usecase gains no benefit from renaming
these files back to ll-merge.[ch], while the other usecase would have
been much improved in my experience from being named merge-ll.[ch].
Granted, it's a really minor point, which was why I never brought it
up until you suggested making all the other *-ll.h files and
ll-merge.[ch] consistent; since renaming the other *-ll.h files made
no sense at all to me, I went with renaming ll-merge.[ch] to
merge-ll.[ch].

There's probably some other angle to this that you two are viewing
this from that just isn't apparent to me.  Sorry for not seeing it
(yet).  Hopefully the above context is at least helpful, though.


  reply	other threads:[~2024-03-09  4:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 14:14 [PATCH 0/4] checkout: cleanup --conflict= Phillip Wood via GitGitGadget
2024-03-08 14:14 ` [PATCH 1/4] xdiff-interface: refactor parsing of merge.conflictstyle Phillip Wood via GitGitGadget
2024-03-08 14:14 ` [PATCH 2/4] merge-ll: introduce LL_MERGE_OPTIONS_INIT Phillip Wood via GitGitGadget
2024-03-08 14:14 ` [PATCH 3/4] merge options: add a conflict style member Phillip Wood via GitGitGadget
2024-03-08 15:46   ` Junio C Hamano
2024-03-08 16:13     ` phillip.wood123
2024-03-08 16:48       ` Junio C Hamano
2024-03-09  4:33         ` Elijah Newren [this message]
2024-03-09  5:46           ` Junio C Hamano
2024-03-08 14:14 ` [PATCH 4/4] checkout: cleanup --conflict=<style> parsing Phillip Wood via GitGitGadget
2024-03-08 16:15   ` Junio C Hamano
2024-03-08 16:22     ` phillip.wood123
2024-03-08 21:40       ` Junio C Hamano
2024-03-11 14:36     ` phillip.wood123
2024-03-11 17:41       ` Junio C Hamano
2024-03-12 15:50         ` Phillip Wood
2024-03-08 15:44 ` [PATCH 0/4] checkout: cleanup --conflict= Junio C Hamano
2024-03-08 16:07   ` phillip.wood123
2024-03-14 17:05 ` [PATCH v2 0/5] " Phillip Wood via GitGitGadget
2024-03-14 17:05   ` [PATCH v2 1/5] xdiff-interface: refactor parsing of merge.conflictstyle Phillip Wood via GitGitGadget
2024-03-14 17:19     ` Junio C Hamano
2024-03-14 17:05   ` [PATCH v2 2/5] merge-ll: introduce LL_MERGE_OPTIONS_INIT Phillip Wood via GitGitGadget
2024-03-14 17:05   ` [PATCH v2 3/5] merge options: add a conflict style member Phillip Wood via GitGitGadget
2024-03-14 17:21     ` Junio C Hamano
2024-03-14 17:05   ` [PATCH v2 4/5] checkout: cleanup --conflict=<style> parsing Phillip Wood via GitGitGadget
2024-03-14 17:24     ` Junio C Hamano
2024-03-14 17:05   ` [PATCH v2 5/5] checkout: fix interaction between --conflict and --merge Phillip Wood via GitGitGadget
2024-03-14 17:32     ` Junio C Hamano
2024-03-14 17:07   ` [PATCH v2 0/5] checkout: cleanup --conflict= Phillip Wood

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BFBNDkdL5Z-VOrv2Z3aWaA3OpWFqd6ZGmU9YC8jBRsAog@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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.
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).