Skip to content

config: document new core.autostage setting#1779

Merged
jorgeorpinel merged 3 commits into
treeverse:masterfrom
bobertlo:autostage
Sep 17, 2020
Merged

config: document new core.autostage setting#1779
jorgeorpinel merged 3 commits into
treeverse:masterfrom
bobertlo:autostage

Conversation

@bobertlo
Copy link
Copy Markdown
Contributor

related to treeverse/dvc#4543

You may disregard these recommendations if you used the Edit on GitHub button from dvc.org to improve a doc in place.

❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.

🐛 Please make sure to mention Fix #issue (if applicable) in the description of the PR. This causes GitHub to close it automatically when the PR is merged.

Please choose to allow us to edit your branch when creating the PR.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

Comment on lines +94 to +97
- `core.autostage` - if enabled, DVC will automatically stage (`git add`)
modified DVC files as it updates them. The files will not be commited, and
user modified files will not be staged unless DVC then later modifies them.
Accepts values `true` and `false` (default).
Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel Sep 16, 2020

Choose a reason for hiding this comment

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

Nice. How about simplifying a little to

if enabled, DVC will automatically stage (`git add`) `.dvc` files(1) created or modified by DVC commands(2). The files will not be committed. Accepts values `true` and `false` (default).

2 questions though:

  1. Does this only affect .dvc files? (Should probably work for all metafiles including dvc.yaml and .lock) — see dvc add config option to auto-stage .dvc files to git dvc#4330 (comment)
  2. Which DVC commands dispay this behavior? Just dvc add? dvc commit? Etc. A full list would be useful.

Thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. That's simpler lol

  1. This includes all modified files.
  2. Any command that changes tracked files should do this?

It replaces the code in the hook to remind you to track files so any command that would make that output would stage the files for commit instead when this is enabled.

Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel Sep 16, 2020

Choose a reason for hiding this comment

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

Thanks.

  1. OK great, let's use [DVC metafiles](/doc/user-guide/dvc-files-and-directories) then, please.
  2. it would be great to try it and double check which ones, and add a list with some of them, the more obvious ones a t least, like add, run, import, maybe commit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still wonder what the exact full list of commands that use that hook is.

@jorgeorpinel
Copy link
Copy Markdown
Contributor

Maybe a note about this in the add cmd ref or in Get Started would be useful?

@bobertlo
Copy link
Copy Markdown
Contributor Author

Okay. I added a blurb in add. I might try to grep out the scm_context hook in the source code, but if there are actions not hooked I think I will view is a pre-existing bug :)

Comment thread content/docs/command-reference/config.md Outdated
Comment thread content/docs/command-reference/add.md Outdated
Comment on lines -54 to +56
6. Instructions are printed showing `git` commands for adding the files, if
appropriate.
6. Instructions are printed showing `git` commands for staging `.dvc` files
(or they are staged automatically if
[`core.autostage`](/doc/command-reference/config#core) is set).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the perfect place for this note, thanks!

I wonder if other there are similar places in other commands that need this same parenthesis...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please if you see any other places, add this in another PR. Thanks

Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

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

Thanks again @bobertlo

@jorgeorpinel jorgeorpinel merged commit a2fb511 into treeverse:master Sep 17, 2020
jorgeorpinel added a commit that referenced this pull request Sep 17, 2020
shcheklein pushed a commit that referenced this pull request Sep 17, 2020
* guide: use back quotes in headers
per #1735 (comment)

* guide: use ```yaml instead of yml (consistency)

* guide: capitalize bullet list

* intsall: remove unnecessary line in Linux/snap

* guide: make H3s into expandable sections in x data docs
per #1735 (comment)

* cmd: cosmetic updates to cache.{type} config option descriptions

* cmd: std option descs in diff
per pending items in #1758

* cmd: small impro to diff

* term: review usage of SCM

* cmd: remove redundant wording in add

* cmd: fix format and typo intro by #1779
@bobertlo
Copy link
Copy Markdown
Contributor Author

@jorgeorpinel oops this feature has been reviewed but not merged into core yet fyi

@jorgeorpinel
Copy link
Copy Markdown
Contributor

Yeahoops I noticed this on the live docs and then realized it´s not merged in core 🤦‍♂️

Oh well it's not a big deal. I doubt anyone will find it and try using it before it's actually released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants