Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a KBI with insights from #15 on config overrides #98

Merged
merged 3 commits into from
Jul 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 53 additions & 0 deletions kbi/0026/index.rst
@@ -0,0 +1,53 @@
.. index::
single: configurations; shared repository

KBI0026: Passing configurations
===============================

:authors: Adina Wagner <adina.wagner@t-online.de>
:discussion: <link>
adswa marked this conversation as resolved.
Show resolved Hide resolved
:keywords: configurations, shared repository clone
:software-versions: datalad_0.19.1, datalad-next_1.0.0b3, git_2.39.2

There are a variety of ways to configure datasets or DataLad operations.
This KBI documents relevant resources, and highlights a few special cases and relevant recent developments about them.

Existing resources
------------------

* A good introduction into the topic of configurations is in the `DataLad Handbook`_.
adswa marked this conversation as resolved.
Show resolved Hide resolved
* An overview of Git-specific configurations can be found by running ``git help --config``, or in the `Git documentation`_.
* An overview of DataLad-specific configurations is in the `technical DataLad documentation`_.
* Specific documentation and examples for the ``datalad configuration`` command are in its `manpage`_. This command can be used to set, unset, or query configurations, and complements the capabilities of ``git config`` with, among other things, additional scopes or recursive operations.

.. _DataLad Handbook: https://handbook.datalad.org/en/latest/basics/basics-configuration.html
.. _Git documentation: https://git-scm.com/docs/git-config#_variables
.. _technical DataLad documentation: http://docs.datalad.org/en/stable/config.html
.. _manpage: http://docs.datalad.org/en/stable/generated/man/datalad-configuration.html


Recent developments
-------------------

The ``-c/--configuration`` flag of the ``datalad`` main command displays a number of shortcomings for specific applications.
One of them is that configurations provided this way do not make it to the target process in every situation.
For example, an attempt to override the user name (``user.name`` Git config) via ``datalad -c user.name=someoneelse save`` would be unsuccessful, and continued to use the user name configured in the applicable ``.config`` file.
adswa marked this conversation as resolved.
Show resolved Hide resolved
This shortcoming was `fixed`_ in May 2023.
At the time of writing, and the fix can be enabled with an installation of `datalad-next`_ and the configuration ``datalad.extensions.load next``, as detailed in the projects documentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that this was meant:

Suggested change
This shortcoming was `fixed`_ in May 2023.
At the time of writing, and the fix can be enabled with an installation of `datalad-next`_ and the configuration ``datalad.extensions.load next``, as detailed in the projects documentation.
This shortcoming was `fixed`_ in May 2023. The fix can be enabled with an installation of `datalad-next`_ and the configuration ``datalad.extensions.load next``, as detailed in the projects documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean, one sentence per line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have more clearly stated my thoughts!

I assumed that line 35 and line 36 were split by "edit-error" and meant to be one line, that expresses what I suggested as line 35, i.e. "This shortcoming was fixed_ in May 2023. The fix can be enabled with an installation of datalad-next_ and the configuration datalad.extensions.load next, as detailed in the projects documentation.".

But I could not be certain that was what you intended, so I commented with: "Not sure that this was meant"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically I write text as one sentence per line, because it makes it easier to see which logical unit changes belong to with a Git diff.
It does not make any difference for the rendering (see e.g., the preview from the CI https://psyinf-knowledge-base--98.org.readthedocs.build/kbi/0026/index.html) in case this is what you are concerned with? Only if a blank line is in between two sentences the paragraph is split.
image

adswa marked this conversation as resolved.
Show resolved Hide resolved

The alternative workaround requires the use of Git configurations in environment variables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not obvious to me how this line connects the following paragraph to the previous one. To what specific issue is the use of Git configurations in environment variables an "alternative workaround"? I read it as "the following is an alternative to using datalad-next to solve the issue of not being able to override the git user name", but what then follows is a description and solution of a different issue (cloning from a shared repo). I'm guessing the issues and workarounds are supposed to be interpreted on a more abstract level, and examples are given to make it more tangible, but I think some rephrasing could be done to make this message clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the critical review, I really appreciate that! I have pushed a restructuring, could you give it a read when its convenient for you and see if that improves coherence?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restructured content makes it all much clearer, thanks!

For example, in order to clone a dataset and initialize it as a shared repository, the following call would only work when `datalad-next`_ is installed and loaded (line breaks added for readability)::
adswa marked this conversation as resolved.
Show resolved Hide resolved

$ datalad -c core.sharedRepository=0600 \
clone <source> <destination>

Without `datalad-next`_, it would succeed with the following environment variables (line breaks added for readability)::

$ GIT_CONFIG_COUNT=1 \
GIT_CONFIG_KEY_0=core.sharedRepository \
GIT_CONFIG_VALUE_0=0600 \
datalad clone <source> <destination>

.. _datalad-next: https://github.com/datalad/datalad-next/
.. _fixed: https://github.com/datalad/datalad-next/pull/399