git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Fernando Ramos <greenfoo@u92.eu>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, git@vger.kernel.org
Subject: Re: fr/vimdiff-layout
Date: Sat, 26 Mar 2022 17:29:32 -0700	[thread overview]
Message-ID: <xmqq4k3k6xw3.fsf@gitster.g> (raw)
In-Reply-To: <Yj+Z0T2TShqH99a/@zacax395.localdomain> (Fernando Ramos's message of "Sat, 26 Mar 2022 23:55:13 +0100")

Fernando Ramos <greenfoo@u92.eu> writes:

>> It looks like it's emitting a new warning from the "Makefile" in
>> check-docs:
>> 	
>> 	$ (make clean && make check-docs) >/dev/null 2>&1; make check-docs
>> 	make -C Documentation lint-docs
>> 	make[1]: Entering directory '/home/avar/g/git/Documentation'
>> 	make[1]: Nothing to be done for 'lint-docs'.
>> 	make[1]: Leaving directory '/home/avar/g/git/Documentation'
>> 	removed but documented: git-difftool--vimdiff
>> 	removed but documented: git-mergetool--vimdiff
>> 	removed but documented: git-version
>
> Looking at how the Makefile works it looks like this error is triggered
> because...
>
>   1. I have created these two new files:
>      - Documentation/git-difftool--vimdiff.txt
>      - Documentation/git-mergetool--vimdiff.txt
>
>   2. None of them are real programs (such as "git-clone") or scripts (such as
>      "git-mergetool--lib.sh")
>
> All the other "Documentation/*.txt" files are associated to "something" that
> can be executed, but not these two (they are only meant to be accessed from "git
> help" / "man").

Thanks for noticing and reporting, Ævar.

I think the right place to describe how vimdiff or other
configuration should be configured should live next to configuration
documentation for other backends.

Documentation/git-mergetool.txt is the main entry point for those
who want to learn about "git mergetool", i.e. "git mergetool --help"
shows what's in there.

The documentation talks about the "mergetool" front-end, and then
includes config/mergetool.txt for the configuration files.

After all, the topic adds only one mergetool.<tool>.layout
configuration variable.  The file config/mergetool.txt would be the
place to describe that variable, after the entry for
mergetool.meld.useAutoMerge, which is already is about a variable
that is specific to a particular backend.  If we can successfully
can go this route, we do not need any new file added at all.

Alternatively, in the longer run, we may want backend specific
information in the "git mergetool --help" documentation.  Maybe
vimdiff is the first and currently only such backend that wants
documentation specific to it, but it does not has to stay that way
forever.

So adding a new section "BACKENDS SPECIFIC HINTS" after "TEMPORARY
FILES" section, and add "VIMDIFF" as its first (and currently only)
subsection, would be a reasonable thing to do.  Create a
Documentation/mergetools/ subdirectory, add vimdiff.txt file in
there, move the most of what is in git-mergetool--vimdiff.txt, and
include it from Documentation/git-mergetool.txt, perhaps like the
attached patch outlines?



diff --git c/Documentation/config/mergetool.txt w/Documentation/config/mergetool.txt
index cafbbef46a..19ca39d43d 100644
--- c/Documentation/config/mergetool.txt
+++ w/Documentation/config/mergetool.txt
@@ -45,6 +45,11 @@ mergetool.meld.useAutoMerge::
 	value of `false` avoids using `--auto-merge` altogether, and is the
 	default value.
 
+mergetool.vimdiff.layout::
+	The vimdiff backend uses this variable to control how its split
+	windows look like.  See BACKEND SPECIFIC HINTS section of
+	linkgit:git-mergetool[1] for details.
+
 mergetool.hideResolved::
 	During a merge Git will automatically resolve as many conflicts as
 	possible and write the 'MERGED' file containing conflict markers around
diff --git c/Documentation/git-mergetool.txt w/Documentation/git-mergetool.txt
index e587c7763a..6cf3734544 100644
--- c/Documentation/git-mergetool.txt
+++ w/Documentation/git-mergetool.txt
@@ -113,6 +113,16 @@ Setting the `mergetool.keepBackup` configuration variable to `false`
 causes `git mergetool` to automatically remove the backup as files
 are successfully merged.
 
+BACKEND SPECIFIC HINTS
+----------------------
+
+Here we'll give backend specific hints.
+
+vimdiff
+~~~~~~~
+include::mergetools/vimdiff.txt[]
+
+
 GIT
 ---
 Part of the linkgit:git[1] suite
diff --git c/Documentation/mergetools/vimdiff.txt w/Documentation/mergetools/vimdiff.txt
new file mode 100644
index 0000000000..1cac121283
--- /dev/null
+++ w/Documentation/mergetools/vimdiff.txt
@@ -0,0 +1,11 @@
+vimdiff
+~~~~~~~
+
+Vimdiff backend allows `mergetools.vimdiff.layout` to specify how
+the split window is used ...
+
+Layout
+^^^^^^
+
+Text.
+

  reply	other threads:[~2022-03-27  0:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24  3:13 What's cooking in git.git (Mar 2022, #05; Wed, 23) Junio C Hamano
2022-03-25 13:38 ` ab/commit-plug-leaks (was: What's cooking in git.git (Mar 2022, #05; Wed, 23)) Ævar Arnfjörð Bjarmason
2022-03-26 16:05 ` fr/vimdiff-layout " Ævar Arnfjörð Bjarmason
2022-03-26 22:55   ` Fernando Ramos
2022-03-27  0:29     ` Junio C Hamano [this message]
2022-03-27 13:18       ` [PATCH] tests: do roundtrip builtin doc & sanity checking Ævar Arnfjörð Bjarmason

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=xmqq4k3k6xw3.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=greenfoo@u92.eu \
    /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).