Line Version, also called LVN, is a Git helper tool for line-level versioning. LVN acts on projects already versioned by Git by traversing their snapshots and generating versions for each line of the tracked files.
LVN has a storage external to the standard Git storage, having its structure represented in JSON-formatted files.
With this tool, the user can explore line-level versioning, being able to get the versions that have already existed for a specific line or for all lines of a given file.
The tool was proposed and developed as a partial requirement for concluding the Project Management course taught by professor Leonardo Murta for the graduate course at the Computation Institute of the Fluminense Federal University.
Follow the instructions for your operating system
- Download the package available
- Extract the compressed folder
- Add bin path to your environment variables
- Check the tool version with the following command:
lvn version
- Download the package available
- Extract the compressed folder
- Grant execution permission to the lvn script
chmod u+x /<path>/lvn/bin/lvn
- Add bin path to variable $PATH
PATH=$PATH:/<path>/lvn/bin
- Check the tool version with the following command:
lvn version
In your Git repository, run the following command to initialize an lvn repository and create its initial storage structure.
lvn init
To version the lines of a file, make sure that the file is already versioned by Git and type the following command.
lvn add <path file>
To get all version of all lines in your versioned file, type the following command.
lvn show <path file>
The result will look something like this:
...
LINE 68:
VERSION 1:
CONTENT: <artifactId>maven-project-info-reports-plugin</artifactId>
AUTHOR: mathunes <[email protected]>
DATE: Wed Oct 19 00:46:00 2022 -0300
MESSAGE: add initial project
HASH COMMIT: cfbf0fbed1d123d15614235f5312052c54344313
VERSION 2:
CONTENT: <artifactId>maven-compiler-plugin</artifactId>
AUTHOR: mathunes <[email protected]>
DATE: Wed Oct 26 22:17:02 2022 -0300
MESSAGE: add plugin to generate uber jar
HASH COMMIT: 99fe6fd4116bad11c0f7974624dea3f4bc54ee45
LINE 69:
VERSION 1:
CONTENT: <version>3.0.0</version>
AUTHOR: mathunes <[email protected]>
DATE: Wed Oct 19 00:46:00 2022 -0300
MESSAGE: add initial project
HASH COMMIT: cfbf0fbed1d123d15614235f5312052c54344313
...
To get all versions of a specific line in your versioned file, type the following command.
lvn show <path file> <line number>
The result will look something like this:
LINE 68:
VERSION 1:
CONTENT: <artifactId>maven-project-info-reports-plugin</artifactId>
AUTHOR: mathunes <[email protected]>
DATE: Wed Oct 19 00:46:00 2022 -0300
MESSAGE: add initial project
HASH COMMIT: cfbf0fbed1d123d15614235f5312052c54344313
VERSION 2:
CONTENT: <artifactId>maven-compiler-plugin</artifactId>
AUTHOR: mathunes <[email protected]>
DATE: Wed Oct 26 22:17:02 2022 -0300
MESSAGE: add plugin to generate uber jar
HASH COMMIT: 99fe6fd4116bad11c0f7974624dea3f4bc54ee45
To get the last version of a specific line in your versioned file, type the following command.
lvn show <path file> <line number> -last
The result will look something like this:
LINE 68:
VERSION 2:
CONTENT: <artifactId>maven-compiler-plugin</artifactId>
AUTHOR: mathunes <[email protected]>
DATE: Wed Oct 26 22:17:02 2022 -0300
MESSAGE: add plugin to generate uber jar
HASH COMMIT: 99fe6fd4116bad11c0f7974624dea3f4bc54ee45
To get all version of all lines in your versioned file graphically, type the following command.
lvn show <path file> -graph
After that, click on the desired line.
If you are using WLS2, follow these instructions to enable the GUI.
- Export the DISPLAY variable with the command:
export DISPLAY=$(hostname).local:0
- Setting up a WSL2 GUI X-Server.
After versioning the lines with the LVN, the Git project will probably evolve and receive new commits. In this case, the LVN base will be out of date with the new versions and to correct this issue, just type the following command to update all the LVN objects.
lvn update
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
After forking the project, follow the instructions below to work locally on the project:
- This project uses maven as dependency manager
- This project uses gitflow as a branch management technique
Compile the code: mvn clean install
Run the tool: java -cp target/line-version-1.1.1-jar-with-dependencies.jar br.uff.ic.App
MIT License
Copyright (c) 2022 Line Version
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.