Skip to content

Commit

Permalink
docs: update for v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bwfiq committed Feb 6, 2025
1 parent 3dae24d commit f808abc
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 36 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

All notable changes to the "git-livesync" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [0.0.1] - 07/02/2025

## [Unreleased]

- Initial release
### Added
- **Automatic Git Commits**: Automatically commits changes to the repository on file modification or creation.
- **Customizable Commit Delay**: Users can set a delay between commits through the configuration settings.
- **Ignore Patterns Management**: Integrates with `.gitignore` to ignore specified patterns when making commits.
- **Responsive to Configuration Changes**: Listens for and adapts to changes in user settings dynamically.
124 changes: 92 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,108 @@ A VS Code extension to watch for file changes and automatically sync them to the

## Features

- Hooks into VS Code's API to watch for file changes
- If the file is not in the `.gitignore` or under `.git/`, it initiates a commit-and-sync with the timestamp and date.
- **Automatic Git Commits**: Automatically commits changes to the repository whenever files are modified or created, ignoring files that are excluded in the `.gitignore`.
- **Customizable Commit Delay**: Configure the delay between commits through settings.

### TODO
## Installation

To install the Git Live Sync extension, follow these steps:

1. Clone this repository:

```bash
git clone https://github.com/bwfiq/git-livesync
cd git-livesync
```

2. Install dependencies:

```bash
npm install
```

3. Build the extension:

```bash
vsce package
```

4. Install the .vsix file in Visual Studio Code:
- Open VS Code and go to the "Extensions" view (Ctrl+Shift+X).
- Click on the three dots in the upper right corner and select "Install from VSIX..."
- Select the generated .vsix file.

## Usage

1. Open your project in Visual Studio Code.
2. Configure the extension by adding settings in your `settings.json` file. For example:
```json
{
"git-livesync.commitDelay": 30,
"git-livesync.enabled": true
}
```
3. The extension will now watch for file changes and commit them automatically.

## Configuration

| Key | Type | Description |
| -------------------------- | ------- | ------------------------------------------------------------------ |
| `git-livesync.commitDelay` | Number | Time in seconds to wait before committing. Default is 30 seconds. |
| `git-livesync.enabled` | Boolean | Enables or disables the extension's operations. Default is `true`. |

## Development

To set up a development environment for the Git Live Sync extension, follow these steps:

1. **Clone the repository**:

```bash
git clone <repository-url>
cd git-livesync
```

2. **Install dependencies**:

```bash
npm install
```

3. **Open the project in Visual Studio Code**.

4. **Build the extension**:

```bash
npm run build
```

5. **Launch the Extension**:
- Press `F5` to run the extension in a new Extension Development Host instance of VS Code.

## TODO

*Planned Features for v0.0.1:*
- Benchmark and remove any slowdowns
- Add a setting to adjust pull and push behaviour instead of always syncing on commit
- Add auto pulling irrespective of file changes
- Add error handling for if workspace doesn't have `.git/` or `.gitignore`

## Requirements
## Contributing

Contributions to the Git Live Sync extension are welcome! Please follow these guidelines:

Take note that the extension works only with remote repositories (for now).
1. Fork the repository.
2. Create a feature branch (`git checkout -b feature/YourFeature`).
3. Commit your changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature/YourFeature`).
5. Open a pull request.

- Node.js version 12.x or above is required.
- Node Dependencies: ignore, simple-git
- Compatible with Visual Studio Code version 1.56.0 or later.
- The extension uses the [`ignore`](https://www.npmjs.com/package/ignore) library for processing `.gitignore` files.

To install required dependencies, run:
```bash
npm install
```
## License

## Extension Settings
This project is licensed under the GNU AGPL v3 License - see the [LICENSE](LICENSE) file for details.

This extension contributes the following settings:
## Acknowledgments

* `git-livesync.enable`: Enable/disable this extension.
* `git-livesync.commitDelay`: Only commit if this amount of time in seconds has passed since the last commit.
- This extension utilizes [simple-git](https://www.npmjs.com/package/simple-git) and [ignore](https://www.npmjs.com/package/ignore) for Git operations.

## Known Issues

Expand All @@ -43,17 +114,6 @@ This extension contributes the following settings:
- [x] There are no workspace-specific settings. It will watch every single opened folder.
- [x] The terminals created are spammed like crazy.
- [x] You need to run a command from the palette to activate the extension.
- [x] It is not packaged as a .vsix file yet.
- [ ] There is no error checking for if the workspace is a git repository or not.
- [ ] There is no error checking for if a .gitignore exists.
- [ ] It is not packaged as a .vsix file yet.

## Release Notes

### Unreleased
- Auto commit-and-sync on file change after delay
- Enabled per workspace-specific setting
- Settings to configure delay in ms for commit-and-sync
- Option to set a scheduled time or every x seconds/minutes to commit-and-sync

# Development
- Get the configuration settings with `getEnabled()` and `getCommitDelay()` (defined and updated in [`utils.ts`](utils.ts))
- [ ] There is no error checking for if a .gitignore exists.

0 comments on commit f808abc

Please sign in to comment.