2
I’m having trouble dealing with file permissions in git. In this case, I need to check if the file has been added with the correct permission mode. As for changing the permissions mode, you already have a question on the subject. But now I need to confirm that the file is in the correct mode.
In the quoted question, the file was already added in the repository, so the git diff
returned only that the permission was changed. Now, however, the file to be added needs to enter specific mode.
When validating with gif diff
, shows me all the changes. For example:
$ git diff HEAD
diff --git a/numobile/android/gradlew b/numobile/android/gradlew
new file mode 100755
index 0000000000..9d82f78915
--- /dev/null
+++ b/numobile/android/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
[ 149 linhas omitidas ... ]
diff --git a/numobile/android/gradlew.bat b/numobile/android/gradlew.bat
new file mode 100644
index 0000000000..aec99730b4
--- /dev/null
+++ b/numobile/android/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
[ 81 linhas omitidas... ]
Currently the modes are correct, the way I wanted for these 2 files in particular. But I wish I could list the listed files and their permissions without having to browse through the entire file added.
For example, showing the file and its permissions (it doesn’t have to be literally like this, it’s just an example: path and permissions):
new file numobile/android/gradlew mode 100755
new file numobile/android/gradlew.bat mode 100644
Just as an observation, I discovered that mentions
HEAD
do not work in repositories without history (obviously, right?). So my alternative was to complete the commit to verify that I had listed it with the correct permission and, if I had done wrong, I wouldgit commit --amend
– Jefferson Quesado