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

Control comments #7

Closed
Timoses opened this issue Nov 15, 2018 · 1 comment
Closed

Control comments #7

Timoses opened this issue Nov 15, 2018 · 1 comment

Comments

@Timoses
Copy link
Owner

Timoses commented Nov 15, 2018

Instead of sections (local and sync) there could be comment control statements to control whether the next line or couple of lines are local.

Control statements are added to the git repository, the comment line is enriched with the host machine name.

dotfile:

<commentIndicator> dotfim local
my local line

gitfile:

<commentIndicator> dotfim local (<HostName>)
my local line

#3 proposes profiles. Dotfim control comments should offer the ability to add lines to specific profile(s) only

<commentIndicator> dotfim profile myprofile1, myprofile2, ...

The default (no comment control statement) means that the line is shared and synced.

Spanning

A feature to span multiple lines with a control comment should be possible:

# dotfim local {
line 1
line 2
# dotfim }

Control comments overview

  • dotfim local: will only be applied to the machine
  • dotfim private: private lines are never written to the git repository. They are the only lines remaining when unsyncing a file (dotfim remove)
  • dotfim profile <profile1>,<profile2>,...: only applied to dotfile if the machine's dotfim is set up to be synced with the profile dotfim sync --profile=...

Considerations

  • Previously with the git section only the commit hash was compared and the merging/rebasing handled accordingly. With control comments the content has to be regarded as well and merged into the gitfile.
    • An idea could be to segment the gitfile into sections of hosts (where only local and private lines are listed). The
@Timoses
Copy link
Owner Author

Timoses commented Dec 21, 2018

Implemented!
Local and Private passages are synced to gitfile with control comment dotfim Local <LocalHostInfo>. Further, Private passages are SHA256 hashed into gitfile. Leaving out the Private passage from syncing to gitfile is no option, because otherwise the order of the private passages is lost.

Info on implementation of profile control comments has been moved to #3 (Profiles).

@Timoses Timoses closed this as completed Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant