diff --git a/AndroidProjectTooling.sh b/AndroidProjectTooling.sh index baf40d5..417c338 100755 --- a/AndroidProjectTooling.sh +++ b/AndroidProjectTooling.sh @@ -16,6 +16,11 @@ CMDLINE_TOOLS_LATEST_DIR="$CMDLINE_TOOLS_DIR/latest" WRAPPER_JAR_PATH="$PROJECT_DIR/gradle/wrapper/gradle-wrapper.jar" LOCAL_PROPERTIES_PATH="$PROJECT_DIR/local.properties" HOST_GIT_BINARY="$PROJECT_DIR/build/host-git/libgit.so" +GIT_SRC_DIR="$TMP_DIR/git-src" +HOST_GIT_DIR="$PROJECT_DIR/build/host-git" +ANDROID_JNI_DIR="$PROJECT_DIR/app/src/main/jniLibs" +ANDROID_ASSET_MANPAGE_DIR="$PROJECT_DIR/app/src/main/assets/manpages" +ANDROID_API=24 ANDROID_CMDLINE_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" GRADLE_DIST_URL="https://services.gradle.org/distributions/gradle-8.7-bin.zip" @@ -24,6 +29,7 @@ ANDROID_NDK_PACKAGE="ndk;27.2.12479018" ANDROID_CMAKE_PACKAGE="cmake;3.22.1" ANDROID_NDK_DIR="$SDK_DIR/ndk/27.2.12479018" ANDROID_CMAKE_DIR="$SDK_DIR/cmake/3.22.1" +ANDROID_TOOLBIN="$ANDROID_NDK_DIR/toolchains/llvm/prebuilt/linux-x86_64/bin" STATE_TTL_SECONDS=86400 log() { @@ -252,6 +258,128 @@ setup_env() { export GRADLE_USER_HOME="$GRADLE_USER_HOME_DIR" } +require_path() { + if [ ! -e "$1" ]; then + echo "Required path not found: $1" >&2 + exit 1 + fi +} + +ensure_git_source() { + mkdir -p "$TMP_DIR" + if [ ! -d "$GIT_SRC_DIR/.git" ]; then + log "Cloning Git source" + git clone --depth 1 https://github.com/git/git.git "$GIT_SRC_DIR" + else + log "Using existing Git source checkout" + fi +} + +common_git_make_args() { + printf '%s\n' \ + NO_OPENSSL=YesPlease \ + NO_CURL=YesPlease \ + NO_EXPAT=YesPlease \ + NO_GETTEXT=YesPlease \ + NO_TCLTK=YesPlease \ + NO_PERL=YesPlease \ + NO_PYTHON=YesPlease \ + NO_INSTALL_HARDLINKS=YesPlease \ + NO_ICONV=YesPlease \ + NO_REGEX=NeedsStartEnd \ + HAVE_ALLOCA_H=YesPlease \ + HAVE_PATHS_H=YesPlease \ + HAVE_CLOCK_GETTIME=YesPlease \ + HAVE_CLOCK_MONOTONIC=YesPlease \ + HAVE_GETDELIM=YesPlease \ + FREAD_READS_DIRECTORIES=UnfortunatelyYes \ + CSPRNG_METHOD= +} + +bundle_git_manpages() { + require_path "$GIT_SRC_DIR/Documentation" + + log "Bundling full Git manpage sources" + mkdir -p "$ANDROID_ASSET_MANPAGE_DIR" + find "$ANDROID_ASSET_MANPAGE_DIR" -type f -name '*.txt' -delete + while IFS= read -r manpage_source; do + local manpage_name + manpage_name="$(basename "$manpage_source")" + cp "$manpage_source" "$ANDROID_ASSET_MANPAGE_DIR/${manpage_name%.*}.txt" + done < <(find "$GIT_SRC_DIR/Documentation" -maxdepth 1 -type f \( -name 'git*.txt' -o -name 'git*.adoc' -o -name 'gitignore.txt' -o -name 'gitignore.adoc' \)) +} + +build_host_git() { + ensure_git_source + bundle_git_manpages + + log "Building Git for development host" + cd "$GIT_SRC_DIR" + make clean >/dev/null 2>&1 || true + mapfile -t make_args < <(common_git_make_args) + make -j"$(nproc 2>/dev/null || printf 4)" "${make_args[@]}" git + + mkdir -p "$HOST_GIT_DIR" + cp git "$HOST_GIT_BINARY" + chmod 755 "$HOST_GIT_BINARY" + + log "Host test Git binary: $HOST_GIT_BINARY" + "$HOST_GIT_BINARY" --version + cd "$PROJECT_DIR" +} + +build_android_git_for_abi() { + local abi="$1" + local cc="$2" + local output_dir="$ANDROID_JNI_DIR/$abi" + + require_path "$ANDROID_TOOLBIN/$cc" + + log "Building Git for Android $abi" + cd "$GIT_SRC_DIR" + make clean >/dev/null 2>&1 || true + mapfile -t make_args < <(common_git_make_args) + make -j"$(nproc 2>/dev/null || printf 4)" \ + uname_S=Android \ + uname_O=Android \ + NO_PTHREADS=YesPlease \ + NO_LIBGEN_H=YesPlease \ + HAVE_DEV_TTY=YesPlease \ + CC="$cc" \ + AR=llvm-ar \ + RANLIB=llvm-ranlib \ + STRIP=llvm-strip \ + "${make_args[@]}" \ + git + + log "Validating Android $abi binary" + file git + readelf -h git | sed -n '1,12p' + + mkdir -p "$output_dir" + llvm-strip -s git -o "$output_dir/libgit.so" + chmod 755 "$output_dir/libgit.so" + ls -lh "$output_dir/libgit.so" + cd "$PROJECT_DIR" +} + +build_android_git() { + ensure_git_source + bundle_git_manpages + require_path "$ANDROID_NDK_DIR" + export PATH="$ANDROID_TOOLBIN:$PATH" + + build_android_git_for_abi "arm64-v8a" "aarch64-linux-android${ANDROID_API}-clang" + build_android_git_for_abi "armeabi-v7a" "armv7a-linux-androideabi${ANDROID_API}-clang" + build_android_git_for_abi "x86" "i686-linux-android${ANDROID_API}-clang" + build_android_git_for_abi "x86_64" "x86_64-linux-android${ANDROID_API}-clang" +} + +build_all_git_targets() { + build_host_git + build_android_git +} + ensure_sdk_packages() { setup_env @@ -302,6 +430,7 @@ maybe_run_operation() { local should_bump_version="false" local should_auto_commit="false" local should_compile_host_git="false" + local should_bundle_manpages="false" case "$mode" in --build) @@ -311,14 +440,7 @@ maybe_run_operation() { artifact_target="$PROJECT_DIR/app/build/outputs/apk/debug/githug-android-debug.apk" should_bump_version="true" should_auto_commit="true" - ;; - --build-aab) - gradle_task="bundleDebug" - artifact_label="debug AAB" - artifact_source="$PROJECT_DIR/app/build/outputs/bundle/debug/app-debug.aab" - artifact_target="$PROJECT_DIR/app/build/outputs/bundle/debug/githug-android-debug.aab" - should_bump_version="true" - should_auto_commit="true" + should_bundle_manpages="true" ;; --build-release-aab) gradle_task="bundleRelease" @@ -327,6 +449,7 @@ maybe_run_operation() { artifact_target="$PROJECT_DIR/app/build/outputs/bundle/release/githug-android-release.aab" should_bump_version="true" should_auto_commit="true" + should_bundle_manpages="true" ;; --test) gradle_task="testDebugUnitTest" @@ -334,7 +457,7 @@ maybe_run_operation() { should_compile_host_git="true" ;; --compile-git) - "$PROJECT_DIR/CompileGitForAllTargetPlatforms.sh" --all + build_all_git_targets return ;; *) @@ -347,9 +470,13 @@ maybe_run_operation() { bump_android_version fi if [ "$should_compile_host_git" = "true" ]; then - "$PROJECT_DIR/CompileGitForAllTargetPlatforms.sh" --host + build_host_git export GITHUG_TEST_GIT_BINARY="$HOST_GIT_BINARY" fi + if [ "$should_bundle_manpages" = "true" ]; then + ensure_git_source + bundle_git_manpages + fi log "Running $artifact_label with --no-daemon" "$PROJECT_DIR/gradlew" --no-daemon "$gradle_task" @@ -371,10 +498,9 @@ maybe_run_operation() { print_usage() { cat <&2 @@ -405,6 +531,7 @@ main() { require_tool clang require_tool pkg-config require_tool readelf + require_tool file ensure_dir "$TMP_DIR" ensure_dir "$SDK_DIR" @@ -426,7 +553,6 @@ main() { log "To compile Git for host and Android ABIs: bash ./AndroidProjectTooling.sh --compile-git" log "To build without a background Gradle daemon: ./gradlew --no-daemon assembleDebug" log "To set up and build in one step: bash ./AndroidProjectTooling.sh --build" - log "To set up and build a debug AAB in one step: bash ./AndroidProjectTooling.sh --build-aab" log "To set up and build a release AAB in one step: bash ./AndroidProjectTooling.sh --build-release-aab" log "To set up and run unit tests with compiled host Git: bash ./AndroidProjectTooling.sh --test" } diff --git a/README.md b/README.md index ae8b40c..e7f2cdc 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The app is organized around GitHug parity rather than simplified command quizzes - Each level file documents the intended repository setup, evaluation strategy, hints, command suggestions, and embedded solution scenarios. - Validators prefer repository state and Git objects over raw command text. Direct command-answer validation is reserved for upstream answer-style levels such as identifying a hash, filename, remote URL, author, or count. - Shared tests execute the embedded solution scenarios for every level and assert that the Android catalog still matches the upstream level order. -- The runtime prepares an isolated sandbox per level. When a bundled native Git binary is present, Git commands run against real repository directories; otherwise the Kotlin fallback engine keeps development and tests deterministic. +- The runtime prepares an isolated sandbox per level and requires a bundled native Git binary for the device ABI. If no native Git binary is available, the app shows an unavailable-build message instead of starting a playable session. The UI supports a terminal-centered workflow with optional inspection panes: @@ -46,7 +46,6 @@ Available commands: | `bash ./AndroidProjectTooling.sh` | Provision or refresh the local Android/JDK toolchain only. | Toolchain under `./jdk` and `./android-sdk` | | `bash ./AndroidProjectTooling.sh --test` | Compile host Git, set `GITHUG_TEST_GIT_BINARY`, and run JVM unit tests. | Test reports under `app/build/reports/` | | `bash ./AndroidProjectTooling.sh --build` | Build the debug APK. | `app/build/outputs/apk/debug/githug-android-debug.apk` | -| `bash ./AndroidProjectTooling.sh --build-aab` | Build the debug Android App Bundle. | `app/build/outputs/bundle/debug/githug-android-debug.aab` | | `bash ./AndroidProjectTooling.sh --build-release-aab` | Build the release Android App Bundle. | `app/build/outputs/bundle/release/githug-android-release.aab` | | `bash ./AndroidProjectTooling.sh --compile-git` | Compile Git for the development host and all Android target ABIs. | Host and Android `libgit.so` binaries | @@ -60,7 +59,6 @@ To build installable/debuggable artifacts: ```bash bash ./AndroidProjectTooling.sh --build -bash ./AndroidProjectTooling.sh --build-aab ``` To build the release AAB intended for Play Store style distribution work: @@ -77,34 +75,33 @@ To avoid repeated expensive SDK verification, the script writes a small state fi If all required components were verified successfully, the script will skip SDK verification/reinstallation for the next **24 hours** unless required directories are missing. -When `--build`, `--build-aab`, or `--build-release-aab` is used, the script also: +When `--build` or `--build-release-aab` is used, the script also: - increments `versionCode` by 1 - increments the patch component of `versionName`, for example `0.1.0` to `0.1.1` +- bundles full Git manpage source files from Git's `Documentation/` directory into app assets - renames the generated artifact to a stable `githug-android-*` filename - attempts to create a git commit after a successful build if there are source changes The build commands currently run these Gradle tasks: - `--build`: `assembleDebug` -- `--build-aab`: `bundleDebug` - `--build-release-aab`: `bundleRelease` ## Git Binary Compilation -Native Git is compiled with: +Native Git compilation is integrated into the root tooling script: ```bash -bash ./CompileGitForAllTargetPlatforms.sh [--host | --android | --all] +bash ./AndroidProjectTooling.sh --compile-git ``` Options: | Command | Purpose | Output | | --- | --- | --- | -| `bash ./CompileGitForAllTargetPlatforms.sh --host` | Compile Git for the development machine. | `build/host-git/libgit.so` | -| `bash ./CompileGitForAllTargetPlatforms.sh --android` | Cross-compile Git for Android ABIs served by Google Play. | `app/src/main/jniLibs//libgit.so` | -| `bash ./CompileGitForAllTargetPlatforms.sh --all` | Compile both host and Android targets. This is the default. | Host and Android outputs | +| `bash ./AndroidProjectTooling.sh --test` | Compile Git for the development machine, then run tests with it. | `build/host-git/libgit.so` and test reports | +| `bash ./AndroidProjectTooling.sh --compile-git` | Compile host Git and cross-compile Android ABIs served by Google Play. | Host and Android outputs | Android ABI outputs: @@ -113,22 +110,17 @@ Android ABI outputs: - `app/src/main/jniLibs/x86/libgit.so` - `app/src/main/jniLibs/x86_64/libgit.so` -The `--test` tooling command automatically runs `CompileGitForAllTargetPlatforms.sh --host` first and exports `GITHUG_TEST_GIT_BINARY=build/host-git/libgit.so`. This keeps JVM tests on the same `GitRepositoryRuntime` path as the app, including the packaged-runtime helper resolution behavior. +The `--test` tooling command automatically builds host Git first and exports `GITHUG_TEST_GIT_BINARY=build/host-git/libgit.so`. This keeps JVM tests on the same `GitRepositoryRuntime` path as the app, including the packaged-runtime helper resolution behavior. -The `--compile-git` tooling command is a convenience wrapper for: - -```bash -bash ./CompileGitForAllTargetPlatforms.sh --all -``` +Git manpage assets are also refreshed from the checked-out Git source whenever Git is compiled or an app artifact is built. ## Runtime Architecture -The command engine has two execution paths behind one app-facing runtime: +The command engine has one app-facing runtime: -- **Native Git path**: if the packaged executable is present for the device ABI, Git commands execute in a real per-level repository sandbox in app-private storage. -- **Kotlin fallback path**: the in-memory sandbox engine mirrors the same observable repository facts for development, JVM tests, and environments without a bundled native Git binary. +- **Native Git path**: the packaged executable for the device ABI runs Git commands in a real per-level repository sandbox in app-private storage. -Both paths expose the same `RepoState` surface to validators. In addition to files, commits, branches, tags, remotes, and config, the model tracks learning-relevant effects such as stashes, fetched remote refs, pushed branches/tags, submodules, and repository maintenance actions. +The runtime exposes a `RepoState` surface to validators. In addition to files, commits, branches, tags, remotes, and config, the model tracks learning-relevant effects such as stashes, fetched remote refs, pushed branches/tags, submodules, and repository maintenance actions. Helper shell-like commands (`ls`, `pwd`, `cat`, `touch`, `mkdir`, `rm`, `echo`, `cd`) remain implemented in Kotlin so the mobile terminal behaves consistently across devices. @@ -149,5 +141,4 @@ Current work is focused on: - improving parity with upstream Ruby Githug setup and validation semantics - expanding native-Git-backed behavior across complex repository workflows -- preserving robust fallback tests for every level - improving onboarding, accessibility, UI polish, icons, and Play Store readiness diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7ec6592..9384c3b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -19,8 +19,8 @@ android { applicationId = "solutions.tretter.githugandroid" minSdk = 26 targetSdk = 35 - versionCode = 128 - versionName = "0.1.127" + versionCode = 129 + versionName = "0.1.128" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/assets/manpages/git-add.txt b/app/src/main/assets/manpages/git-add.txt new file mode 100644 index 0000000..941135d --- /dev/null +++ b/app/src/main/assets/manpages/git-add.txt @@ -0,0 +1,460 @@ +git-add(1) +========== + +NAME +---- +git-add - Add file contents to the index + +SYNOPSIS +-------- +[synopsis] +git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] + [--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse] + [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize] + [--chmod=(+|-)x] [--pathspec-from-file= [--pathspec-file-nul]] + [--] [...] + +DESCRIPTION +----------- +Add contents of new or changed files to the index. The "index" (also +known as the "staging area") is what you use to prepare the contents of +the next commit. + +When you run `git commit` without any other arguments, it will only +commit staged changes. For example, if you've edited `file.c` and want +to commit your changes to that file, you can run: + + git add file.c + git commit + +You can also add only part of your changes to a file with `git add -p`. + +This command can be performed multiple times before a commit. It only +adds the content of the specified file(s) at the time the add command is +run; if you want subsequent changes included in the next commit, then +you must run `git add` again to add the new content to the index. + +The `git status` command can be used to obtain a summary of which +files have changes that are staged for the next commit. + +The `git add` command will not add ignored files by default. You can +use the `--force` option to add ignored files. If you specify the exact +filename of an ignored file, `git add` will fail with a list of ignored +files. Otherwise it will silently ignore the file. + +Please see linkgit:git-commit[1] for alternative ways to add content to a +commit. + + +OPTIONS +------- +`...`:: + Files to add content from. Fileglobs (e.g. `*.c`) can + be given to add all matching files. Also a + leading directory name (e.g. `dir` to add `dir/file1` + and `dir/file2`) can be given to update the index to + match the current state of the directory as a whole (e.g. + specifying `dir` will record not just a file `dir/file1` + modified in the working tree, a file `dir/file2` added to + the working tree, but also a file `dir/file3` removed from + the working tree). Note that older versions of Git used + to ignore removed files; use `--no-all` option if you want + to add modified or new files but ignore removed ones. ++ +For more details about the __ syntax, see the 'pathspec' entry +in linkgit:gitglossary[7]. + +`-n`:: +`--dry-run`:: + Don't actually add the file(s), just show if they exist and/or will + be ignored. + +`-v`:: +`--verbose`:: + Be verbose. + +`-f`:: +`--force`:: + Allow adding otherwise ignored files. The option is also used when + `submodule..ignore=all` is set, but you want to stage an + update of the submodule. The `path` to the submodule must be explicitly + specified. + +`--sparse`:: + Allow updating index entries outside of the sparse-checkout cone. + Normally, `git add` refuses to update index entries whose paths do + not fit within the sparse-checkout cone, since those files might + be removed from the working tree without warning. See + linkgit:git-sparse-checkout[1] for more details. + +`-i`:: +`--interactive`:: + Add modified contents in the working tree interactively to + the index. Optional path arguments may be supplied to limit + operation to a subset of the working tree. See ``Interactive + mode'' for details. + +`-p`:: +`--patch`:: + Interactively choose hunks of patch between the index and the + work tree and add them to the index. This gives the user a chance + to review the difference before adding modified contents to the + index. ++ +This effectively runs `add --interactive`, but bypasses the +initial command menu and directly jumps to the `patch` subcommand. +See ``Interactive mode'' for details. + +include::diff-context-options.adoc[] + +`-e`:: +`--edit`:: + Open the diff vs. the index in an editor and let the user + edit it. After the editor was closed, adjust the hunk headers + and apply the patch to the index. ++ +The intent of this option is to pick and choose lines of the patch to +apply, or even to modify the contents of lines to be staged. This can be +quicker and more flexible than using the interactive hunk selector. +However, it is easy to confuse oneself and create a patch that does not +apply to the index. See EDITING PATCHES below. + +`-u`:: +`--update`:: + Update the index just where it already has an entry matching + __. This removes as well as modifies index entries to + match the working tree, but adds no new files. ++ +If no __ is given when `-u` option is used, all +tracked files in the entire working tree are updated (old versions +of Git used to limit the update to the current directory and its +subdirectories). + +`-A`:: +`--all`:: +`--no-ignore-removal`:: + Update the index not only where the working tree has a file + matching __ but also where the index already has an + entry. This adds, modifies, and removes index entries to + match the working tree. ++ +If no __ is given when `-A` option is used, all +files in the entire working tree are updated (old versions +of Git used to limit the update to the current directory and its +subdirectories). + +`--no-all`:: +`--ignore-removal`:: + Update the index by adding new files that are unknown to the + index and files modified in the working tree, but ignore + files that have been removed from the working tree. This + option is a no-op when no __ is used. ++ +This option is primarily to help users who are used to older +versions of Git, whose `git add ...` was a synonym +for `git add --no-all ...`, i.e. ignored removed files. + +`-N`:: +`--intent-to-add`:: + Record only the fact that the path will be added later. An entry + for the path is placed in the index with no content. This is + useful for, among other things, showing the unstaged content of + such files with `git diff` and committing them with `git commit + -a`. + +`--refresh`:: + Don't add the file(s), but only refresh their stat() + information in the index. + +`--ignore-errors`:: + If some files could not be added because of errors indexing + them, do not abort the operation, but continue adding the + others. The command shall still exit with non-zero status. + The configuration variable `add.ignoreErrors` can be set to + true to make this the default behaviour. + +`--ignore-missing`:: + This option can only be used together with `--dry-run`. By using + this option the user can check if any of the given files would + be ignored, no matter if they are already present in the work + tree or not. + +`--no-warn-embedded-repo`:: + By default, `git add` will warn when adding an embedded + repository to the index without using `git submodule add` to + create an entry in `.gitmodules`. This option will suppress the + warning (e.g., if you are manually performing operations on + submodules). + +`--renormalize`:: + Apply the "clean" process freshly to all tracked files to + forcibly add them again to the index. This is useful after + changing `core.autocrlf` configuration or the `text` attribute + in order to correct files added with wrong _CRLF/LF_ line endings. + This option implies `-u`. Lone CR characters are untouched, thus + while a _CRLF_ cleans to _LF_, a _CRCRLF_ sequence is only partially + cleaned to _CRLF_. + +`--chmod=(+|-)x`:: + Override the executable bit of the added files. The executable + bit is only changed in the index, the files on disk are left + unchanged. + +`--pathspec-from-file=`:: + Pathspec is passed in __ instead of commandline args. If + __ is exactly `-` then standard input is used. Pathspec + elements are separated by _LF_ or _CR/LF_. Pathspec elements can be + quoted as explained for the configuration variable `core.quotePath` + (see linkgit:git-config[1]). See also `--pathspec-file-nul` and + global `--literal-pathspecs`. + +`--pathspec-file-nul`:: + Only meaningful with `--pathspec-from-file`. Pathspec elements are + separated with _NUL_ character and all other characters are taken + literally (including newlines and quotes). + +`--`:: + This option can be used to separate command-line options from + the list of files, (useful when filenames might be mistaken + for command-line options). + + +EXAMPLES +-------- + +* Adds content from all ++*.txt++ files under `Documentation` directory + and its subdirectories: ++ +------------ +$ git add Documentation/\*.txt +------------ ++ +Note that the asterisk ++*++ is quoted from the shell in this +example; this lets the command include the files from +subdirectories of `Documentation/` directory. + +* Considers adding content from all ++git-*.sh++ scripts: ++ +------------ +$ git add git-*.sh +------------ ++ +Because this example lets the shell expand the asterisk (i.e. you are +listing the files explicitly), it does not consider +`subdir/git-foo.sh`. + +INTERACTIVE MODE +---------------- +When the command enters the interactive mode, it shows the +output of the 'status' subcommand, and then goes into its +interactive command loop. + +The command loop shows the list of subcommands available, and +gives a prompt "What now> ". In general, when the prompt ends +with a single '>', you can pick only one of the choices given +and type return, like this: + +------------ + *** Commands *** + 1: status 2: update 3: revert 4: add untracked + 5: patch 6: diff 7: quit 8: help + What now> 1 +------------ + +You also could say `s` or `sta` or `status` above as long as the +choice is unique. + +The main command loop has 6 subcommands (plus help and quit). + +status:: + + This shows the change between `HEAD` and index (i.e. what will be + committed if you say `git commit`), and between index and + working tree files (i.e. what you could stage further before + `git commit` using `git add`) for each path. A sample output + looks like this: ++ +------------ + staged unstaged path + 1: binary nothing foo.png + 2: +403/-35 +1/-1 add-interactive.c +------------ ++ +It shows that `foo.png` has differences from `HEAD` (but that is +binary so line count cannot be shown) and there is no +difference between indexed copy and the working tree +version (if the working tree version were also different, +'binary' would have been shown in place of 'nothing'). The +other file, `add-interactive.c`, has 403 lines added +and 35 lines deleted if you commit what is in the index, but +working tree file has further modifications (one addition and +one deletion). + +update:: + + This shows the status information and issues an "Update>>" + prompt. When the prompt ends with double '>>', you can + make more than one selection, concatenated with whitespace or + comma. Also you can say ranges. E.g. "2-5 7,9" to choose + 2,3,4,5,7,9 from the list. If the second number in a range is + omitted, all remaining patches are taken. E.g. "7-" to choose + 7,8,9 from the list. You can say '*' to choose everything. ++ +What you chose are then highlighted with '*', +like this: ++ +------------ + staged unstaged path + 1: binary nothing foo.png +* 2: +403/-35 +1/-1 add-interactive.c +------------ ++ +To remove selection, prefix the input with `-` +like this: ++ +------------ +Update>> -2 +------------ ++ +After making the selection, answer with an empty line to stage the +contents of working tree files for selected paths in the index. + +revert:: + + This has a very similar UI to 'update', and the staged + information for selected paths are reverted to that of the + HEAD version. Reverting new paths makes them untracked. + +add untracked:: + + This has a very similar UI to 'update' and + 'revert', and lets you add untracked paths to the index. + +patch:: + + This lets you choose one path out of a 'status' like selection. + After choosing the path, it presents the diff between the index + and the working tree file and asks you if you want to stage + the change of each hunk. You can select one of the following + options and type return: + + y - stage this hunk + n - do not stage this hunk + q - quit; do not stage this hunk or any of the remaining ones + a - stage this hunk and all later hunks in the file + d - do not stage this hunk or any of the later hunks in the file + g - select a hunk to go to + / - search for a hunk matching the given regex + j - go to the next undecided hunk, roll over at the bottom + J - go to the next hunk, roll over at the bottom + k - go to the previous undecided hunk, roll over at the top + K - go to the previous hunk, roll over at the top + s - split the current hunk into smaller hunks + e - manually edit the current hunk + p - print the current hunk + P - print the current hunk using the pager + ? - print help ++ +After deciding the fate for all hunks, if there is any hunk +that was chosen, the index is updated with the selected hunks. ++ +You can omit having to type return here, by setting the configuration +variable `interactive.singleKey` to `true`. + +diff:: + + This lets you review what will be committed (i.e. between + `HEAD` and index). + + +EDITING PATCHES +--------------- + +Invoking `git add -e` or selecting `e` from the interactive hunk +selector will open a patch in your editor; after the editor exits, the +result is applied to the index. You are free to make arbitrary changes +to the patch, but note that some changes may have confusing results, or +even result in a patch that cannot be applied. If you want to abort the +operation entirely (i.e., stage nothing new in the index), simply delete +all lines of the patch. The list below describes some common things you +may see in a patch, and which editing operations make sense on them. + +-- +added content:: + +Added content is represented by lines beginning with "{plus}". You can +prevent staging any addition lines by deleting them. + +removed content:: + +Removed content is represented by lines beginning with "-". You can +prevent staging their removal by converting the "-" to a " " (space). + +modified content:: + +Modified content is represented by "-" lines (removing the old content) +followed by "{plus}" lines (adding the replacement content). You can +prevent staging the modification by converting "-" lines to " ", and +removing "{plus}" lines. Beware that modifying only half of the pair is +likely to introduce confusing changes to the index. +-- + +There are also more complex operations that can be performed. But beware +that because the patch is applied only to the index and not the working +tree, the working tree will appear to "undo" the change in the index. +For example, introducing a new line into the index that is in neither +the `HEAD` nor the working tree will stage the new line for commit, but +the line will appear to be reverted in the working tree. + +Avoid using these constructs, or do so with extreme caution. + +-- +removing untouched content:: + +Content which does not differ between the index and working tree may be +shown on context lines, beginning with a " " (space). You can stage +context lines for removal by converting the space to a "-". The +resulting working tree file will appear to re-add the content. + +modifying existing content:: + +One can also modify context lines by staging them for removal (by +converting " " to "-") and adding a "{plus}" line with the new content. +Similarly, one can modify "{plus}" lines for existing additions or +modifications. In all cases, the new modification will appear reverted +in the working tree. + +new content:: + +You may also add new content that does not exist in the patch; simply +add new lines, each starting with "{plus}". The addition will appear +reverted in the working tree. +-- + +There are also several operations which should be avoided entirely, as +they will make the patch impossible to apply: + +* adding context (" ") or removal ("-") lines +* deleting context or removal lines +* modifying the contents of context or removal lines + +CONFIGURATION +------------- + +include::includes/cmd-config-section-all.adoc[] + +:git-add: 1 +include::config/add.adoc[] + +SEE ALSO +-------- +linkgit:git-status[1] +linkgit:git-rm[1] +linkgit:git-reset[1] +linkgit:git-mv[1] +linkgit:git-commit[1] +linkgit:git-update-index[1] + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/app/src/main/assets/manpages/git-am.txt b/app/src/main/assets/manpages/git-am.txt new file mode 100644 index 0000000..ac65852 --- /dev/null +++ b/app/src/main/assets/manpages/git-am.txt @@ -0,0 +1,316 @@ +git-am(1) +========= + +NAME +---- +git-am - Apply a series of patches from a mailbox + + +SYNOPSIS +-------- +[verse] +'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--[no-]verify] + [--[no-]3way] [--interactive] [--committer-date-is-author-date] + [--ignore-date] [--ignore-space-change | --ignore-whitespace] + [--whitespace=] [-C] [-p] [--directory=] + [--exclude=] [--include=] [--reject] [-q | --quiet] + [--[no-]scissors] [-S[]] [--patch-format=] + [--quoted-cr=] + [--empty=(stop|drop|keep)] + [( | )...] +'git am' (--continue | --skip | --abort | --quit | --retry | --show-current-patch[=(diff|raw)] | --allow-empty) + +DESCRIPTION +----------- +Splits mail messages in a mailbox into commit log messages, +authorship information, and patches, and applies them to the +current branch. You could think of it as a reverse operation +of linkgit:git-format-patch[1] run on a branch with a straight +history without merges. + +OPTIONS +------- +(|)...:: + The list of mailbox files to read patches from. If you do not + supply this argument, the command reads from the standard input. + If you supply directories, they will be treated as Maildirs. + +-s:: +--signoff:: + Add a `Signed-off-by` trailer to the commit message (see + linkgit:git-interpret-trailers[1]), using the committer identity + of yourself. See the signoff option in linkgit:git-commit[1] + for more information. + +-k:: +--keep:: + Pass `-k` flag to linkgit:git-mailinfo[1]. + +--keep-non-patch:: + Pass `-b` flag to linkgit:git-mailinfo[1]. + +--keep-cr:: +--no-keep-cr:: + With `--keep-cr`, call linkgit:git-mailsplit[1] + with the same option, to prevent it from stripping CR at the end of + lines. `am.keepcr` configuration variable can be used to specify the + default behaviour. `--no-keep-cr` is useful to override `am.keepcr`. + +-c:: +--scissors:: + Remove everything in body before a scissors line (see + linkgit:git-mailinfo[1]). Can be activated by default using + the `mailinfo.scissors` configuration variable. + +--no-scissors:: + Ignore scissors lines (see linkgit:git-mailinfo[1]). + +--quoted-cr=:: + This flag will be passed down to linkgit:git-mailinfo[1]. + +--empty=(drop|keep|stop):: + How to handle an e-mail message lacking a patch: ++ +-- +`drop`;; + The e-mail message will be skipped. +`keep`;; + An empty commit will be created, with the contents of the e-mail + message as its log. +`stop`;; + The command will fail, stopping in the middle of the current `am` + session. This is the default behavior. +-- + +-m:: +--message-id:: + Pass the `-m` flag to linkgit:git-mailinfo[1], + so that the `Message-ID` header is added to the commit message. + The `am.messageid` configuration variable can be used to specify + the default behaviour. + +--no-message-id:: + Do not add the Message-ID header to the commit message. + `--no-message-id` is useful to override `am.messageid`. + +-q:: +--quiet:: + Be quiet. Only print error messages. + +-u:: +--utf8:: + Pass `-u` flag to linkgit:git-mailinfo[1]. + The proposed commit log message taken from the e-mail + is re-coded into UTF-8 encoding (configuration variable + `i18n.commitEncoding` can be used to specify the project's + preferred encoding if it is not UTF-8). ++ +This was optional in prior versions of git, but now it is the +default. You can use `--no-utf8` to override this. + +--no-utf8:: + Pass `-n` flag to linkgit:git-mailinfo[1]. + +-3:: +--3way:: +--no-3way:: + When the patch does not apply cleanly, fall back on + 3-way merge if the patch records the identity of blobs + it is supposed to apply to and we have those blobs + available locally. `--no-3way` can be used to override + am.threeWay configuration variable. For more information, + see am.threeWay in linkgit:git-config[1]. + +include::rerere-options.adoc[] + +--ignore-space-change:: +--ignore-whitespace:: +--whitespace=:: +-C:: +-p:: +--directory=:: +--exclude=:: +--include=:: +--reject:: + These flags are passed to the linkgit:git-apply[1] program that + applies the patch. ++ +Valid for the `--whitespace` option are: +`nowarn`, `warn`, `fix`, `error`, and `error-all`. + +--patch-format:: + By default the command will try to detect the patch format + automatically. This option allows the user to bypass the automatic + detection and specify the patch format that the patch(es) should be + interpreted as. Valid formats are mbox, mboxrd, + stgit, stgit-series, and hg. + +-i:: +--interactive:: + Run interactively. + +--verify:: +-n:: +--no-verify:: + Run the `pre-applypatch` and `applypatch-msg` hooks. This is the + default. Skip these hooks with `-n` or `--no-verify`. See also + linkgit:githooks[5]. ++ +Note that `post-applypatch` cannot be skipped. + +--committer-date-is-author-date:: + By default the command records the date from the e-mail + message as the commit author date, and uses the time of + commit creation as the committer date. This allows the + user to lie about the committer date by using the same + value as the author date. ++ +WARNING: The history walking machinery assumes that commits have +non-decreasing commit timestamps. You should consider if you really need +to use this option. Then you should only use this option to override the +committer date when applying commits on top of a base which commit is +older (in terms of the commit date) than the oldest patch you are +applying. + +--ignore-date:: + By default the command records the date from the e-mail + message as the commit author date, and uses the time of + commit creation as the committer date. This allows the + user to lie about the author date by using the same + value as the committer date. + +--skip:: + Skip the current patch. This is only meaningful when + restarting an aborted patch. + +-S[]:: +--gpg-sign[=]:: +--no-gpg-sign:: + GPG-sign commits. The `keyid` argument is optional and + defaults to the committer identity; if specified, it must be + stuck to the option without a space. `--no-gpg-sign` is useful to + countermand both `commit.gpgSign` configuration variable, and + earlier `--gpg-sign`. + +--continue:: +-r:: +--resolved:: + After a patch failure (e.g. attempting to apply + conflicting patch), the user has applied it by hand and + the index file stores the result of the application. + Make a commit using the authorship and commit log + extracted from the e-mail message and the current index + file, and continue. + +--resolvemsg=:: + When a patch failure occurs, will be printed + to the screen before exiting. This overrides the + standard message informing you to use `--continue` + or `--skip` to handle the failure. This is solely + for internal use between linkgit:git-rebase[1] and + linkgit:git-am[1]. + +--abort:: + Restore the original branch and abort the patching operation. + Revert the contents of files involved in the am operation to their + pre-am state. + +--quit:: + Abort the patching operation but keep HEAD and the index + untouched. + +--retry:: + Try to apply the last conflicting patch again. This is generally + only useful for passing extra options to the retry attempt + (e.g., `--3way`), since otherwise you'll just see the same + failure again. + +--show-current-patch[=(diff|raw)]:: + Show the message at which linkgit:git-am[1] has stopped due to + conflicts. If `raw` is specified, show the raw contents of + the e-mail message; if `diff`, show the diff portion only. + Defaults to `raw`. + +--allow-empty:: + After a patch failure on an input e-mail message lacking a patch, + create an empty commit with the contents of the e-mail message + as its log message. + +[[discussion]] +DISCUSSION +---------- + +The commit author name is taken from the "From: " line of the +message, and commit author date is taken from the "Date: " line +of the message. The "Subject: " line is used as the title of +the commit, after stripping common prefix "[PATCH ]". +The "Subject: " line is supposed to concisely describe what the +commit is about in one line of text. + +"From: ", "Date: ", and "Subject: " lines starting the body override the +respective commit author name and title values taken from the headers. + +The commit message is formed by the title taken from the +"Subject: ", a blank line and the body of the message up to +where the patch begins. Excess whitespace at the end of each +line is automatically stripped. + +The patch is expected to be inline, directly following the +message. +include::format-patch-end-of-commit-message.adoc[] + +This means that the contents of the commit message can inadvertently +interrupt the processing (see the <> section below). + +When initially invoking linkgit:git-am[1], you give it the names of the mailboxes +to process. Upon seeing the first patch that does not apply, it +aborts in the middle. You can recover from this in one of two ways: + +. skip the current patch by re-running the command with the `--skip` + option. + +. hand resolve the conflict in the working directory, and update + the index file to bring it into a state that the patch should + have produced. Then run the command with the `--continue` option. + +The command refuses to process new mailboxes until the current +operation is finished, so if you decide to start over from scratch, +run `git am --abort` before running the command with mailbox +names. + +Before any patches are applied, ORIG_HEAD is set to the tip of the +current branch. This is useful if you have problems with multiple +commits, like running linkgit:git-am[1] on the wrong branch or an error +in the commits that is more easily fixed by changing the mailbox (e.g. +errors in the "From:" lines). + +[[caveats]] +CAVEATS +------- + +:git-am: 1 +include::format-patch-caveats.adoc[] + +HOOKS +----- +This command can run `applypatch-msg`, `pre-applypatch`, +and `post-applypatch` hooks. See linkgit:githooks[5] for more +information. + +See the `--verify`/`-n`/`--no-verify` options. + +CONFIGURATION +------------- + +include::includes/cmd-config-section-all.adoc[] + +include::config/am.adoc[] + +SEE ALSO +-------- +linkgit:git-apply[1], +linkgit:git-format-patch[1]. + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/app/src/main/assets/manpages/git-annotate.txt b/app/src/main/assets/manpages/git-annotate.txt new file mode 100644 index 0000000..965bc67 --- /dev/null +++ b/app/src/main/assets/manpages/git-annotate.txt @@ -0,0 +1,33 @@ +git-annotate(1) +=============== + +NAME +---- +git-annotate - Annotate file lines with commit information + +SYNOPSIS +-------- +[verse] +'git annotate' [] [] [] [--] + +DESCRIPTION +----------- +Annotates each line in the given file with information from the commit +which introduced the line. Optionally annotates from a given revision. + +The only difference between this command and linkgit:git-blame[1] is that +they use slightly different output formats, and this command exists only +for backward compatibility to support existing scripts, and provide a more +familiar command name for people coming from other SCM systems. + +OPTIONS +------- +include::blame-options.adoc[] + +SEE ALSO +-------- +linkgit:git-blame[1] + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/app/src/main/assets/manpages/git-apply.txt b/app/src/main/assets/manpages/git-apply.txt new file mode 100644 index 0000000..6c71ee6 --- /dev/null +++ b/app/src/main/assets/manpages/git-apply.txt @@ -0,0 +1,299 @@ +git-apply(1) +============ + +NAME +---- +git-apply - Apply a patch to files and/or to the index + + +SYNOPSIS +-------- +[verse] +'git apply' [--stat] [--numstat] [--summary] [--check] + [--index | --intent-to-add] [--3way] [--ours | --theirs | --union] + [--apply] [--no-add] [--build-fake-ancestor=] [-R | --reverse] + [--allow-binary-replacement | --binary] [--reject] [-z] + [-p] [-C] [--inaccurate-eof] [--recount] [--cached] + [--ignore-space-change | --ignore-whitespace] + [--whitespace=(nowarn|warn|fix|error|error-all)] + [--exclude=] [--include=] [--directory=] + [--verbose | --quiet] [--unsafe-paths] [--allow-empty] [...] + +DESCRIPTION +----------- +Reads the supplied diff output (i.e. "a patch") and applies it to files. +When running from a subdirectory in a repository, patched paths +outside the directory are ignored. +With the `--index` option, the patch is also applied to the index, and +with the `--cached` option, the patch is only applied to the index. +Without these options, the command applies the patch only to files, +and does not require them to be in a Git repository. + +This command applies the patch but does not create a commit. Use +linkgit:git-am[1] to create commits from patches generated by +linkgit:git-format-patch[1] and/or received by email. + +OPTIONS +------- +...:: + The files to read the patch from. '-' can be used to read + from the standard input. + +--stat:: + Instead of applying the patch, output diffstat for the + input. Turns off "apply". + +--numstat:: + Similar to `--stat`, but shows the number of added and + deleted lines in decimal notation and the pathname without + abbreviation, to make it more machine friendly. For + binary files, outputs two `-` instead of saying + `0 0`. Turns off "apply". + +--summary:: + Instead of applying the patch, output a condensed + summary of information obtained from git diff extended + headers, such as creations, renames, and mode changes. + Turns off "apply". + +--check:: + Instead of applying the patch, see if the patch is + applicable to the current working tree and/or the index + file and detects errors. Turns off "apply". + +--index:: + Apply the patch to both the index and the working tree (or + merely check that it would apply cleanly to both if `--check` is + in effect). Note that `--index` expects index entries and + working tree copies for relevant paths to be identical (their + contents and metadata such as file mode must match), and will + raise an error if they are not, even if the patch would apply + cleanly to both the index and the working tree in isolation. + +--cached:: + Apply the patch to just the index, without touching the working + tree. If `--check` is in effect, merely check that it would + apply cleanly to the index entry. + +-N:: +--intent-to-add:: + When applying the patch only to the working tree, mark new + files to be added to the index later (see `--intent-to-add` + option in linkgit:git-add[1]). This option is ignored if + `--index` or `--cached` are used, and has no effect outside a Git + repository. Note that `--index` could be implied by other options + such as `--3way`. + +-3:: +--3way:: + Attempt 3-way merge if the patch records the identity of blobs it is supposed + to apply to and we have those blobs available locally, possibly leaving the + conflict markers in the files in the working tree for the user to + resolve. This option implies the `--index` option unless the + `--cached` option is used, and is incompatible with the `--reject` option. + When used with the `--cached` option, any conflicts are left at higher stages + in the cache. + +--ours:: +--theirs:: +--union:: + Instead of leaving conflicts in the file, resolve conflicts favouring + our (or their or both) side of the lines. Requires --3way. + +--build-fake-ancestor=:: + Newer 'git diff' output has embedded 'index information' + for each blob to help identify the original version that + the patch applies to. When this flag is given, and if + the original versions of the blobs are available locally, + builds a temporary index containing those blobs. ++ +When a pure mode change is encountered (which has no index information), +the information is read from the current index instead. + +-R:: +--reverse:: + Apply the patch in reverse. + +--reject:: + For atomicity, 'git apply' by default fails the whole patch and + does not touch the working tree when some of the hunks + do not apply. This option makes it apply + the parts of the patch that are applicable, and leave the + rejected hunks in corresponding *.rej files. + +-z:: + When `--numstat` has been given, do not munge pathnames, + but use a NUL-terminated machine-readable format. ++ +Without this option, pathnames with "unusual" characters are quoted as +explained for the configuration variable `core.quotePath` (see +linkgit:git-config[1]). + +-p:: + Remove leading path components (separated by slashes) from + traditional diff paths. E.g., with `-p2`, a patch against + `a/dir/file` will be applied directly to `file`. The default is + 1. + +-C:: + Ensure at least lines of surrounding context match before + and after each change. When fewer lines of surrounding + context exist they all must match. By default no context is + ever ignored. + +--unidiff-zero:: + By default, 'git apply' expects that the patch being + applied is a unified diff with at least one line of context. + This provides good safety measures, but breaks down when + applying a diff generated with `--unified=0`. To bypass these + checks use `--unidiff-zero`. ++ +Note, for the reasons stated above, the usage of context-free patches is +discouraged. + +--apply:: + If you use any of the options marked "Turns off + 'apply'" above, 'git apply' reads and outputs the + requested information without actually applying the + patch. Give this flag after those flags to also apply + the patch. + +--no-add:: + When applying a patch, ignore additions made by the + patch. This can be used to extract the common part between + two files by first running 'diff' on them and applying + the result with this option, which would apply the + deletion part but not the addition part. + +--allow-binary-replacement:: +--binary:: + Historically we did not allow binary patch application + without an explicit permission from the user, and this + flag was the way to do so. Currently, we always allow binary + patch application, so this is a no-op. + +--exclude=:: + Don't apply changes to files matching the given path pattern. This can + be useful when importing patchsets, where you want to exclude certain + files or directories. + +--include=:: + Apply changes to files matching the given path pattern. This can + be useful when importing patchsets, where you want to include certain + files or directories. ++ +When `--exclude` and `--include` patterns are used, they are examined in the +order they appear on the command line, and the first match determines if a +patch to each path is used. A patch to a path that does not match any +include/exclude pattern is used by default if there is no include pattern +on the command line, and ignored if there is any include pattern. + +--ignore-space-change:: +--ignore-whitespace:: + When applying a patch, ignore changes in whitespace in context + lines if necessary. + Context lines will preserve their whitespace, and they will not + undergo whitespace fixing regardless of the value of the + `--whitespace` option. New lines will still be fixed, though. + +--whitespace=:: + When applying a patch, detect a new or modified line that has + whitespace errors. What are considered whitespace errors is + controlled by `core.whitespace` configuration. By default, + trailing whitespaces (including lines that solely consist of + whitespaces) and a space character that is immediately followed + by a tab character inside the initial indent of the line are + considered whitespace errors. ++ +By default, the command outputs warning messages but applies the patch. +When `git-apply` is used for statistics and not applying a +patch, it defaults to `nowarn`. ++ +You can use different `` values to control this +behavior: ++ +* `nowarn` turns off the trailing whitespace warning. +* `warn` outputs warnings for a few such errors, but applies the + patch as-is (default). +* `fix` outputs warnings for a few such errors, and applies the + patch after fixing them (`strip` is a synonym -- the tool + used to consider only trailing whitespace characters as errors, and the + fix involved 'stripping' them, but modern Gits do more). +* `error` outputs warnings for a few such errors, and refuses + to apply the patch. +* `error-all` is similar to `error` but shows all errors. + +--inaccurate-eof:: + Under certain circumstances, some versions of 'diff' do not correctly + detect a missing new-line at the end of the file. As a result, patches + created by such 'diff' programs do not record incomplete lines + correctly. This option adds support for applying such patches by + working around this bug. + +-v:: +--verbose:: + Report progress to stderr. By default, only a message about the + current patch being applied will be printed. This option will cause + additional information to be reported. + +-q:: +--quiet:: + Suppress stderr output. Messages about patch status and progress + will not be printed. + +--recount:: + Do not trust the line counts in the hunk headers, but infer them + by inspecting the patch (e.g. after editing the patch without + adjusting the hunk headers appropriately). + +--directory=:: + Prepend to all filenames. If a "-p" argument was also passed, + it is applied before prepending the new root. ++ +For example, a patch that talks about updating `a/git-gui.sh` to `b/git-gui.sh` +can be applied to the file in the working tree `modules/git-gui/git-gui.sh` by +running `git apply --directory=modules/git-gui`. + +--unsafe-paths:: + By default, a patch that affects outside the working area + (either a Git controlled working tree, or the current working + directory when "git apply" is used as a replacement of GNU + patch) is rejected as a mistake (or a mischief). ++ +When `git apply` is used as a "better GNU patch", the user can pass +the `--unsafe-paths` option to override this safety check. This option +has no effect when `--index` or `--cached` is in use. + +--allow-empty:: + Don't return an error for patches containing no diff. This includes + empty patches and patches with commit text only. + +CONFIGURATION +------------- + +include::includes/cmd-config-section-all.adoc[] + +include::config/apply.adoc[] + +SUBMODULES +---------- +If the patch contains any changes to submodules then 'git apply' +treats these changes as follows. + +If `--index` is specified (explicitly or implicitly), then the submodule +commits must match the index exactly for the patch to apply. If any +of the submodules are checked-out, then these check-outs are completely +ignored, i.e., they are not required to be up to date or clean and they +are not updated. + +If `--index` is not specified, then the submodule commits in the patch +are ignored and only the absence or presence of the corresponding +subdirectory is checked and (if possible) updated. + +SEE ALSO +-------- +linkgit:git-am[1]. + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/app/src/main/assets/manpages/git-archimport.txt b/app/src/main/assets/manpages/git-archimport.txt new file mode 100644 index 0000000..847777f --- /dev/null +++ b/app/src/main/assets/manpages/git-archimport.txt @@ -0,0 +1,113 @@ +git-archimport(1) +================= + +NAME +---- +git-archimport - Import a GNU Arch repository into Git + + +SYNOPSIS +-------- +[verse] +'git archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D ] [-t ] + /[:]... + +DESCRIPTION +----------- +Imports a project from one or more GNU Arch repositories. +It will follow branches +and repositories within the namespaces defined by the / +parameters supplied. If it cannot find the remote branch a merge comes from +it will just import it as a regular commit. If it can find it, it will mark it +as a merge whenever possible (see discussion below). + +The script expects you to provide the key roots where it can start the import +from an 'initial import' or 'tag' type of Arch commit. It will follow and +import new branches within the provided roots. + +It expects to be dealing with one project only. If it sees +branches that have different roots, it will refuse to run. In that case, +edit your / parameters to define clearly the scope of the +import. + +'git archimport' uses `tla` extensively in the background to access the +Arch repository. +Make sure you have a recent version of `tla` available in the path. `tla` must +know about the repositories you pass to 'git archimport'. + +For the initial import, 'git archimport' expects to find itself in an empty +directory. To follow the development of a project that uses Arch, rerun +'git archimport' with the same parameters as the initial import to perform +incremental imports. + +While 'git archimport' will try to create sensible branch names for the +archives that it imports, it is also possible to specify Git branch names +manually. To do so, write a Git branch name after each / +parameter, separated by a colon. This way, you can shorten the Arch +branch names and convert Arch jargon to Git jargon, for example mapping a +"PROJECT{litdd}devo{litdd}VERSION" branch to "master". + +Associating multiple Arch branches to one Git branch is possible; the +result will make the most sense only if no commits are made to the first +branch, after the second branch is created. Still, this is useful to +convert Arch repositories that had been rotated periodically. + + +MERGES +------ +Patch merge data from Arch is used to mark merges in Git as well. Git +does not care much about tracking patches, and only considers a merge when a +branch incorporates all the commits since the point they forked. The end result +is that Git will have a good idea of how far branches have diverged. So the +import process does lose some patch-trading metadata. + +Fortunately, when you try and merge branches imported from Arch, +Git will find a good merge base, and it has a good chance of identifying +patches that have been traded out-of-sequence between the branches. + +OPTIONS +------- + +-h:: + Display usage. + +-v:: + Verbose output. + +-T:: + Many tags. Will create a tag for every commit, reflecting the commit + name in the Arch repository. + +-f:: + Use the fast patchset import strategy. This can be significantly + faster for large trees, but cannot handle directory renames or + permissions changes. The default strategy is slow and safe. + +-o:: + Use this for compatibility with old-style branch names used by + earlier versions of 'git archimport'. Old-style branch names + were category{litdd}branch, whereas new-style branch names are + archive,category{litdd}branch{litdd}version. In both cases, names given + on the command-line will override the automatically-generated + ones. + +-D :: + Follow merge ancestry and attempt to import trees that have been + merged from. Specify a depth greater than 1 if patch logs have been + pruned. + +-a:: + Attempt to auto-register archives at `http://mirrors.sourcecontrol.net` + This is particularly useful with the -D option. + +-t :: + Override the default tempdir. + + +/:: + / identifier in a format that `tla log` understands. + + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/app/src/main/assets/manpages/git-archive.txt b/app/src/main/assets/manpages/git-archive.txt new file mode 100644 index 0000000..086bade --- /dev/null +++ b/app/src/main/assets/manpages/git-archive.txt @@ -0,0 +1,248 @@ +git-archive(1) +============== + +NAME +---- +git-archive - Create an archive of files from a named tree + + +SYNOPSIS +-------- +[verse] +'git archive' [--format=] [--list] [--prefix=/] [] + [-o | --output=] [--worktree-attributes] + [--remote= [--exec=]] + [...] + +DESCRIPTION +----------- +Creates an archive of the specified format containing the tree +structure for the named tree, and writes it out to the standard +output. If is specified it is +prepended to the filenames in the archive. + +'git archive' behaves differently when given a tree ID as opposed to a +commit ID or tag ID. When a tree ID is provided, the current time is +used as the modification time of each file in the archive. On the +other hand, when a commit ID or tag ID is provided, the commit time as +recorded in the referenced commit object is used instead. +Additionally the commit ID is stored in a global extended pax header +if the tar format is used; it can be extracted using 'git +get-tar-commit-id'. In ZIP files it is stored as a file comment. + +OPTIONS +------- + +--format=:: + Format of the resulting archive. Possible values are `tar`, + `zip`, `tar.gz`, `tgz`, and any format defined using the + configuration option `tar..command`. If `--format` + is not given, and the output file is specified, the format is + inferred from the filename if possible (e.g. writing to `foo.zip` + makes the output to be in the `zip` format). Otherwise the output + format is `tar`. + +-l:: +--list:: + Show all available formats. + +-v:: +--verbose:: + Report progress to stderr. + +--prefix=/:: + Prepend / to paths in the archive. Can be repeated; its + rightmost value is used for all tracked files. See below which + value gets used by `--add-file`. ++ +The is used as given and is not normalized. It may +include leading slashes or parent directory components (e.g., +`../`). Some archive consumers may treat such paths as +potentially unsafe and adjust or warn during extraction. + +-o :: +--output=:: + Write the archive to instead of stdout. + +--add-file=:: + Add a non-tracked file to the archive. Can be repeated to add + multiple files. The path of the file in the archive is built by + concatenating the value of the last `--prefix` option (if any) + before this `--add-file` and the basename of . + +--add-virtual-file=::: + Add the specified contents to the archive. Can be repeated to add + multiple files. ++ +The `` argument can start and end with a literal double-quote +character; the contained file name is interpreted as a C-style string, +i.e. the backslash is interpreted as escape character. The path must +be quoted if it contains a colon, to avoid the colon from being +misinterpreted as the separator between the path and the contents, or +if the path begins or ends with a double-quote character. ++ +The file mode is limited to a regular file, and the option may be +subject to platform-dependent command-line limits. For non-trivial +cases, write an untracked file and use `--add-file` instead. ++ +Note that unlike `--add-file` the path created in the archive is not +affected by the `--prefix` option, as a full `` can be given as +the value of the option. + +--worktree-attributes:: + Look for attributes in .gitattributes files in the working tree + as well (see <>). + +--mtime=