about summary refs log tree commit diff
path: root/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
Commit message (Collapse)AuthorAgeFilesLines
* github #48/0002: vcs_info git: properly detect bare repositoriesbrian m. carlson2020-02-171-0/+4
| | | | | | | | | | | We currently detect Git repositories by finding the top level of the working tree, and if we fail to detect it, assume that we're not in a repository. However, there's a case we don't consider: a bare repository. Let's detect if the user is in a bare repository by checking if gitdir is set, and if so, using that if there is no working tree. We now detect bare Git repositories with vcs_info, as expected.
* github #48/0001: vcs_info git: avoid warnings in bare repositoriesbrian m. carlson2020-02-171-1/+1
| | | | | | | | | | | | Git 2.25 introduced a change to how git rev-parse --show-toplevel behaves. Traditionally, it succeeded with no output if the user was in a bare repository. Now it dies, printing an error to standard error. Consequently, when the user is in a bare repository with a newer Git, vcs_info prints noisily to standard error. While this is functionally harmless, it is annoying for the shell to print messages from Git every time the prompt is printed, so let's silence the error message.
* 43879: vcs_info git: Fix fatal error in VCS_INFO_git_getbranch in corner caseDaniel Shahaf2018-12-131-4/+6
| | | | | | | | | | | | | Before this commit, the following use-case: git checkout foo^ git show foo | git am would result in a fatal error, with vcs_info_msg_N_ not set: VCS_INFO_git_getbranch:18: no such file or directory: .git/rebase-apply/onto Now they are set correctly, and HEAD's commit hash is used.
* 43620 (tweaked): vcs_info git: Reverse the order patches are passed to ↵Daniel Shahaf2018-10-081-1/+2
| | | | | | | | gen-unapplied-string in. This is an incompatible change; see README for details. Tweaks (relative to posted version): tweaked README, removed scalpel (debug print).
* 43617: vcs_info git: During a non-interactive rebase of a detached head, ↵Daniel Shahaf2018-10-081-1/+1
| | | | | | | | | | | | | computer the %b expando correctly. Before this commit, the value of %b was the hash of the commit from the "source" side of the rebase, from .git/rebase-apply/orig-head and .git/rebase-apply/original-commit. This broke the invariant that %b expands to a git-rev-parse(1) expression resolving to what %r expands to. Use .git/rebase-apply/onto instead as, empirically, it contains the correct value.
* 43619: vcs_info git: In non-interactive rebases, always set ↵Daniel Shahaf2018-10-081-10/+3
| | | | $hook_com[git_patches_applied] to a string of the form 'foo bar', never just 'foo'.
* 43618: vcs_info: Don't redefine helper functions on every execution of the ↵Daniel Shahaf2018-10-081-0/+3
| | | | | | | autoloadable outer function. This allows enabling tracing of the helper functions without fned'ing the outer function.
* 43587: vcs_info git: In 'git rebase -i', when computing subjects of ↵Daniel Shahaf2018-10-071-0/+19
| | | | applied-patches, handle an edge case where the subject is not available.
* 43588: vcs_info git: Make sure applied-patches is of the form "$hash ↵Daniel Shahaf2018-10-071-0/+5
| | | | | | | | | | | | $subject" --- that is, has a space and a non-empty second argument --- even with future 'git rebase -i' verbs. Use of '?' is consistent with these precedents: Backends/VCS_INFO_get_data_git:220: printf -v "git_patches_applied[$p]" "%04d ?" "$p" Backends/VCS_INFO_get_data_git:242: git_patches_applied+=("? $subject") Backends/VCS_INFO_get_data_git:244: git_patches_applied+=("?") VCS_INFO_quilt:160: applied[$i]+=" ?" VCS_INFO_quilt:168: unapplied[$i]+=" ?"
* 43586: vcs_info git: Reformat to minimise next diff. No functional change.Daniel Shahaf2018-10-071-2/+13
|
* unposted: Indicate which use-case each branch handles.Daniel Shahaf2018-10-021-1/+3
|
* 43313 (log message tweaked): vcs_info git: For the branch name, try to find ↵Daniel Shahaf2018-08-241-0/+4
| | | | | | | | | | | | a symbolic name before falling back to a raw commit hash. Ask git-describe(1) and git-name-rev(1) to compute a gitrevisions(7) name in terms of a branch or tag that contains (= is a descendant of, is younger than) HEAD. In this repository, the output changes from "9567bfe..." to "master~1" or "remotes/origin/HEAD~1". This would also happen during bisects, e.g., "bisect/bad~22".
* 43314: vcs_info git: Flatten a nested if.Daniel Shahaf2018-08-241-9/+4
| | | | No functional change.
* Julien Nicoulaud: 40586: discard stderrBarton E. Schaefer2017-02-211-1/+1
|
* unposted: vcs_info git: Fix typo in manual.Daniel Shahaf2017-02-041-0/+1
|
* 40480: vcs_info set-patch-format: Eliminate the remaining code duplication.Daniel Shahaf2017-02-031-10/+2
|
* 40479: vcs_info set-patch-format: Prepare for more code sharing between the ↵Daniel Shahaf2017-02-031-1/+2
| | | | | | callers. This changes hook invocation order in the hg backend.
* 40403/0004: vcs_info set-patch-format helper: Part #4.Daniel Shahaf2017-01-251-5/+3
| | | | | This also fixes the %a (${hook_com[all-n]}) expando in the hg backend: before this change, it counted only unapplied changes.
* 40403/0003: vcs_info set-patch-format helper: Part #3.Daniel Shahaf2017-01-251-6/+2
|
* 40403/0002: vcs_info set-patch-format helper: Part #2.Daniel Shahaf2017-01-251-6/+2
| | | | | Not all callers reset ${hook_com}, but those that don't, immediately overwrite it a few lines later.
* 40403/0001: vcs_info set-patch-format helper: Part #1.Daniel Shahaf2017-01-251-10/+1
|
* 40401: vcs_info git: Fix the %c patch-format expando.Daniel Shahaf2017-01-251-3/+3
| | | | | | | | Before this change, ${git_unapplied_s} was unused and the %c (${hook_com[unapplied]}) expando evaluated to the number of digits in the string returned by the gen-unapplied-string hook (or to the number of digits in the number of unapplied patches, when there was no such hook).
* 40149: vcs_info git: Avoid a fork.Daniel Shahaf2016-12-161-1/+1
|
* unposted: vcs_info git: Handle rebase-apply sequences with >=10000 patches.Daniel Shahaf2016-12-041-3/+6
| | | | Review-by: Frank Terbeck
* 40074: vcs_info git: rfc822-unfold rebase-apply patch subjects when ↵Daniel Shahaf2016-12-041-8/+7
| | | | | | | | msg-clean is unavailable. Example (in this repository): git -c merge.merge-changelog.driver=/bin/false rebase --onto=1955cce^^ 1955cce^ 1955cce
* Get subject of current patch in rebase-apply modeDaniel Hahler2016-12-031-0/+9
|
* 39423: vcs_info git: Produce nicer applied-string messages for 'exec' actions.Daniel Shahaf2016-09-241-2/+6
| | | | | This changes the behaviour on "unknown" git-rebase actions (those other than pick/reword/edit/fixup/squash/execute).
* 37612: vcs_info git: Set $git_patches_unapplied correctly for 'rebase-apply' ↵Daniel Shahaf2016-01-151-1/+3
| | | | | | case. This manifested, e.g., in 'git am' of a single patch that had a conflict.
* 37252: vcs_info git: Compute %b correctly with "rebase --onto" of detached ↵Daniel Shahaf2015-11-301-1/+2
| | | | heads. (Follow-up to 36725.)
* 37025: vcs_info git: Add a cherry-pick patch-formatDaniel Shahaf2015-11-131-0/+22
|
* 36832: vcs_info: Remove dependency on "seq"Frank Terbeck2015-10-111-2/+3
| | | | | | The "seq" utility is usually available on GNU systems only. This exchanges calls to seq with pure zsh features. Also: Less forks are good.
* 36830: vcs_info: Silence an error message with new git versionsFrank Terbeck2015-10-111-12/+22
| | | | | | | | | | | | Mikael informs me on IRC, that in new versions of git (he used 2.6.1) where the "am" subcommand is now a builtin, a file that is used by the git backend of vcs_info (namely .git/rebase-apply/msg-clean) is not available anymore, leading to an annoying error message: VCS_INFO_get_data_git:232: no such file or directory: .git/rebase-apply/msg-clean This patch checks for the availabiliy of the file before using it, and adjusts the value of the dependant values accordingly.
* 36725: vcs_info git: Compute %b correctly when "git am"-ing onto detached heads.Daniel Shahaf2015-09-301-0/+1
| | | | | | | | Before this patch, $gitbranch would be set to empty, which caused VCS_INFO_get_data_git to early out with a failure status¹, consequently $vcs_info_msg_0_ would be empty. ¹ via the 'if [[ -z ]]' block around line 170.
* 36725: vcs_info git: Compute %b correctly when rebasing detached heads.Daniel Shahaf2015-09-301-0/+4
| | | | | | This sets the %b expando to the hash of the before-the-merge HEAD, rather than to the literal string "detached HEAD". That hash is already available via the gen-applied-string hook.
* 36725: vcs_info git: Compute %b correctly when merging to detached heads.Daniel Shahaf2015-09-301-1/+1
| | | | | The %b expando should be the hash prior to the merge. The hash of the merge result is available as the %i expando and via the gen-applied-string hook.
* 36601: vcs_info: handle missing .git/rebase-apply/{next,msg-clean}Daniel Hahler2015-09-281-11/+14
| | | | | | | When pressing Ctrl-C after `git am`, only `last` exists in `.git/rebase-apply/`, which is empty. This patch fixes it to fall back to "no patch applied" then.
* 36410: vcs_info git: Present merge heads as patchesDaniel Shahaf2015-09-051-0/+17
| | | | | | | This shows, during 'git merge', the revision hashes of the "remote" head (the one that will become second parent of the commit) in the %m expando. Review-by: Frank Terbeck
* 36209: vcs_info: avoid grep error message when file is missingbrian m. carlson2015-08-181-1/+3
| | | | | | | When running git rebase -m and a conflict occurs, the git-rebase-todo file is not present. This leads to an error from grep every time the shell prompt is printed when vcs_info is enabled. Avoid this message by checking if the file exists before trying to grep it.
* 34673: vcs_info git: Fix error message when rebase hasn't startedDaniel Shahaf2015-03-091-0/+1
|
* 33391: vcs_info git: fix applied patch detection on git amMarc Finet2014-10-091-10/+7
| | | | | | | | | git-am also uses .git/rebase-apply for patch list but the file original-commit does not exist (as no commit exist). This patch handles both git rebase and git am. Also: - get the first line (rather than the first char) when the message contains only one line; - remove unused function (ironically that should have been used here).
* 33217: vcs_info: use `--ignore-submodules=dirty` with diff/diff-indexDaniel Hahler2014-09-221-3/+3
| | | | | | | | | | | This will detect changes to submodules from the superproject's perspective, e.g. after `git rm submodule`. >From GIT-DIFF-INDEX(1)/GIT-DIFF(1): Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior until 1.7.0).
* 33184: vcs_info git: consider patches for rebaseMarc Finet2014-09-161-42/+74
| | | | | | | | Since a rebase contains a list of patches to re-apply, re-use the facility for stgit to have the same mechanism. The patch list given to the gen-{un,}applied-string hooks is an array with the sha1 and the subject of the commit. On rebase merge, the applied patches prior to current contains only a number and "?".
* 33188: vcs_info git: set rrn before using itMarc Finet2014-09-161-2/+2
| | | | | This would fix handling get-revision, check-for-changes or check-for-staged-changes when set per repository.
* 33145: vcs_info git: fix applied-string nameMarc Finet2014-09-141-1/+1
| | | | | Documentation and hg backend use applied-string. patch-string does not appear anywhere.
* 33147: vcs_info git: detect revert or cherry-pick with multiple commitsMarc Finet2014-09-141-0/+5
| | | | | When revert or cherry-pick involve many commits the .git/sequencer directory holds context for the action and no CHERRY_PICK_HEAD exist.
* 32662: vcs_info git: Fix stagedstr for empty reposDaniel Shahaf2014-06-021-4/+10
| | | | | | In empty repositories, HEAD is an unresolvable symbolic ref. Start computing stagedstr/unstagedstr in that case; for the former, use a different method than the non-empty-repository case.
* 32597: vcs_info git: Describe detached heads symbolically.Daniel Shahaf2014-05-061-1/+1
| | | | | | | This makes %b expand to a refname rather than a sha1 when HEAD is detached but happens to match some ref (branch, tag, etc). The resulting output will typically contain a slash (e.g., "tags/v1.0.2", "heads/mybranch"), which helps distinguish it from the output in the "HEAD is a symbolic ref" case.
* 32528: vcs_info: Add check-for-staged-changesDaniel Shahaf2014-04-051-5/+16
|
* 32066: fix %r and %S in vcs_info formats when a repository subdirectory is ↵Barton E. Schaefer2013-11-291-1/+1
| | | | | | accessed via a symlink 31985 Clemens Hammacher and 32064 Hong Xu
* 31485: vcs_info, git: Avoid error messages for `guilt' usersFrank Terbeck2013-06-181-1/+3
| | | | | | | | | | Guilt uses the same internal directory for keeping state as stgit, but it doesn't use the same files (not surprisingly). This caused error messages due to missing files. This fixes that by making the "stgit-active?" test stricter. Reported-by: Axel Beckert <abe@debian.org>