Ayu-hack / Hacktoberfest-Contributions

This repository helps beginners contribute to open source and participate in Hacktoberfest. We welcome all pull requests (Python & Java), prioritize genuine contributions, and promote good first issues! #hacktoberfest2022 #hacktoberfest2023 #hacktoberfest2024
20 stars 51 forks source link

Added solution for File Version Control Using Hashing #96

Closed pratikj697 closed 1 month ago

pratikj697 commented 1 month ago

introduced a VersionControlSystem class that provides a simple way to manage file versions based on their content changes. The implementation allows users to add versions of files, generate SHA-256 hashes to detect changes, and display all stored versions for any given file.

Features

  1. File Versioning: Users can add a new version of a file only if its content has changed, avoiding unnecessary duplicates.
  2. SHA-256 Hashing: Each file's content is hashed using SHA-256 to uniquely identify its version. This ensures reliable detection of changes.
  3. Error Handling: The system includes error handling for cases where files do not exist or cannot be accessed, providing user-friendly messages.
  4. Version Display: Users can retrieve and display all versions of a specific file along with their corresponding hashes.

Test Cases

  1. The code includes test cases demonstrating the addition of versions for existing files, detection of unchanged files, and handling of non-existent files.
  2. Test cases ensure that the expected outputs match the functionality of the VersionControlSystem.

Future Enhancements

  1. Implement additional features such as removing specific versions or restoring previous versions.
  2. Enhance the interface to support versioning of directories.
  3. Consider integrating a database for better storage and retrieval of version histories.

How to Test

  1. Create some text files (file1.txt and file2.txt) to test the functionality.
  2. Run the script and observe the outputs for adding versions and displaying version information.
  3. Modify the contents of file1.txt and run the add_version method again to see the detection of changes.

Screenshot 2024-10-05 193241 issue #93

Ayu-hack commented 1 month ago

merged. More repos are available for pull requests, and they’re part of Hacktoberfest 2024. Feel free to tag me in your Hacktoberfest certificate or badges LinkedIn post! 😄 👉 Follow my GitHub and connect with me on LinkedIn! ⭐ Star these repos to stay updated for next year’s Hacktoberfest!

pratikj697 commented 1 month ago

Why it's get excluded.

Ayu-hack commented 1 month ago

no buddy it is not excluded. Please share the screenshot.

pratikj697 commented 1 month ago

IMG_20241007_150814 Its get excluded Today.

Ayu-hack commented 1 month ago

Please consider contributing to this repo: https://github.com/Ayu-hack/Hacktoberfest2024 Sorry for the inconvenience, and thank you for your understanding! 🙏

Ayu-hack commented 1 month ago

Someone falsely reported the repos. really sorry please contribute to new one link given above.