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

feat: add rename-file command #1149

Merged
merged 4 commits into from
Aug 2, 2024
Merged

Conversation

CodeByZach
Copy link
Contributor

@CodeByZach CodeByZach commented Jul 10, 2024

Rename a file or directory and ensure Git recognizes the change, regardless of filesystem case-sensitivity. It combines the functionality of the mv command and git mv. This is particularly useful for renaming files or directories to change only their case, which might not be detected by Git on case-insensitive filesystems.

I initially considered naming it git-mv due to its intuitive functionality. However, I noticed that the naming convention in the repository includes both commands with and without the dash following "git-". To avoid conflict with the native git mv command, I opted for git-rename-file instead.

  • Added new command 'rename-file' to rename files and directories within a Git repository regardless of filesystem case-sensitivity.
  • Updated AUTHORS and documentation in Commands.md.
  • Implemented bash, zsh, and fish completions for 'rename-file'.
  • Created manual pages for 'rename-file' in various formats (man, html, md).
  • Updated index.txt to include 'rename-file' command.

- Added new command 'rename-file' to rename files and directories within a Git repository regardless of filesystem case-sensitivity.
- Updated AUTHORS and documentation in Commands.md.
- Implemented bash, zsh, and fish completions for 'rename-file'.
- Created manual pages for 'rename-file' in various formats (man, html, md).
- Updated index.txt to include 'rename-file' command.
@CodeByZach CodeByZach marked this pull request as ready for review July 10, 2024 00:42
bin/git-rename-file Show resolved Hide resolved
bin/git-rename-file Show resolved Hide resolved
bin/git-rename-file Show resolved Hide resolved
bin/git-rename-file Outdated Show resolved Hide resolved
bin/git-rename-file Outdated Show resolved Hide resolved
# Check if the destination directory exists
DEST_DIR=$(dirname "$DESTINATION")
if ! check_case_sensitive_exists "$DEST_DIR"; then
echo "Error: Destination directory '$DEST_DIR' does not exist."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, but it would be good to redirect all errors to standard error. I believe that's consistent with the rest of the code;

@hyperupcall
Copy link
Collaborator

Thanks, this looks good - I had a few suggestions;

@CodeByZach
Copy link
Contributor Author

Apologies, just catching up here. What's left before this can be merged?

@hyperupcall
Copy link
Collaborator

hyperupcall commented Jul 24, 2024

@CodeByZach Hey, a must is to have the lint check in CI pass (if it's a lot of issues, running shfmt locally should speed things up). While you do that it would be a good idea to address the code change recommendations

@CodeByZach
Copy link
Contributor Author

CodeByZach commented Jul 24, 2024

@CodeByZach Hey, a must is to have the lint check in CI pass (if it's a lot of issues, running shfmt locally should speed things up). While you do that it would be a good idea to address the code change recommendations

Seems easy enough. Will get on it.
image

@spacewander spacewander requested a review from hyperupcall July 26, 2024 03:12
@hyperupcall
Copy link
Collaborator

hyperupcall commented Jul 26, 2024

@CodeByZach Thank you for the update; I'll be able to merge this once @spacewander's comments here and here are addressed;

@CodeByZach
Copy link
Contributor Author

@CodeByZach Thank you for the update; I'll be able to merge this once @spacewander's comments here and here are addressed;

Should now be addressed.

Copy link
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, changes are good

@hyperupcall hyperupcall merged commit c32869d into tj:main Aug 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants