question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading hosts sources in a git submodule

See original GitHub issue

Hi, First off, lots of thanks to your project and all data providers! I have been a long time user and have recently started to contribute back.

Currently, I suppose your workflow is the following: Every few days, you run the updateHostsFile.py in your local git repo and then push it to this online repo. However, when users (who) clone your repo (even a shallow clone), they receive the python scripts among other things as well as the hosts sources in the data and alternate folders. As such, I, for instance, want to keep (only) the code in the scripts up to date with this repo and hence run git pull every few days. However, running updateHostsFile.py locally for me introduces new changes which often cause conflicts when I git pull again. Of course, this can be solved by making a fresh clone of the repo (via git reset for instance); but this seems like a hacky way to do it.

My point being that, I think it will be a good addition to separate the hosts sources from the actual python engine (script) which does the actual work. A good way to tackle this can be to use git submodules for this purpose. So, to spell it out, (as I have it in my mind) the main python scripts, tests, etc could be in one repo and the hosts sources (content) will be another repo added to the former as a git submodule. This can also give a solution to #272 .

I am willing to write the code for a blueprint / final version of this idea. Please let me know what you think of the idea. Also, on another note, do you have a communication platform (IRC / Telegram / Riot)? I wanted to ask this there first, but couldn’t find any.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, May 13, 2018

I see your point. In fact, if one uses git submodules the process for cloning the repo (just as any user does now) and updating it (using git pull, for instance) stays essentially the same (except for changes in some commands of course).

On the other hand, advanced users can update hosts files on their machines daily (every few hours, etc). If you feel that’s overkill, it’s okay. I had the idea that this repo was supposed to be a “download this script and run daily on your own” sort of thing.

Also, if one decides to have different extensions, and use this repo’s script, there is some gitfu to be done in the current setup if they update sources on their own. Anyway, git submodules do have some things to take care of, that I agree.

I hope my problem was clear regardless.

0reactions
StevenBlackcommented, May 14, 2018

Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make git-submodule update from specific Host in config
1 Answer 1 ... The touchy part is that a submodule's url is intended to be committed and shared. You can live with...
Read more >
How to Utilize Submodules within Git Repos - Bits and Pieces
So, first things first, create the repo to be imported into the other project (the submodule). In my case, I created a repo...
Read more >
Using Git submodules with GitLab CI/CD
Use Git submodules to keep a Git repository as a subdirectory of another Git repository. You can clone another repository into your project...
Read more >
Git - Submodules - Git SCM
Let's start by adding an existing Git repository as a submodule of the repository that we're working on. To add a new submodule...
Read more >
Git submodule - Atlassian
A git submodule is a record within a host git repository that points to a specific commit in another external repository. Learn more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found