summaryrefslogtreecommitdiff
path: root/show-branch.c
AgeCommit message (Collapse)AuthorFilesLines
2005-10-01Add git-symbolic-refLibravatar Junio C Hamano1-4/+9
This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
2005-09-24show-branch: fix commit naming breakage.Libravatar Junio C Hamano1-1/+14
It was ignoring the generation number of the commit when naming 2nd and later parents, showing "(linus^n)^2" for any <n> incorrectly as "linus^2". Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-19show-branch: Be nicer when running in a corrupt repository.Libravatar Junio C Hamano1-2/+5
We may end up trying to print a commit we do not actually have but we know about its existence only because another commit we do have refers to it. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from b204feab9371040982d2c60611925e7693106c84 commit)
2005-09-10Fix 'git-show-branch --list <head>'Libravatar Junio C Hamano1-1/+1
It mistakenly failed to output anything when given a single head. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-09show-branch: --list and --independentLibravatar Junio C Hamano1-15/+59
The --list option is what 'git branch' without parameter should have been; it shows the one-line commit message for each branch name. The --independent option is used to filter out commits that can be reachable from other commits, to make detection of fast forward condition in multi-head merge easier. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-08Show all merge-base candidates from show-branch --merge-baseLibravatar Junio C Hamano1-3/+5
This would make things easier to use for Octopus. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-30show-branch: make it work in a subdirectory.Libravatar Junio C Hamano1-0/+2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-29Updates: show-branchLibravatar Junio C Hamano1-22/+108
Earlier show-branch gave names only to commits reachable via first parent ancestry chain. Change the naming code to name everybody. The original idea was to stop at the first merge point in the topological order, and --more=<n> to show commits until we show <n> more extra merge points. However depending on the order of how we discover the commits, it additionally showed parents of the <n>th merge points, which was unnecessary. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-24Sort branch names snarfed from refs/ hierarchy.Libravatar Junio C Hamano1-3/+21
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-22Clean-up output from "git show-branch" and document it.Libravatar Junio C Hamano1-6/+20
When showing only one branch a lot of default output becomes redundant, so clean it up a bit, and document what is shown. Retire the earlier implementation "git-show-branches-script". Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-22[PATCH] Add 'git show-branch'.Libravatar Junio C Hamano1-0/+325
The 'git show-branches' command turns out to be reasonably useful, but painfully slow. So rewrite it in C, using ideas from merge-base while enhancing it a bit more. - Unlike show-branches, it can take --heads (show me all my heads), --tags (show me all my tags), or --all (both). - It can take --more=<number> to show beyond the merge-base. - It shows the short name for each commit in the extended SHA1 syntax. - It can find merge-base for more than two heads. Examples: $ git show-branch --more=6 HEAD is almost the same as "git log --pretty=oneline --max-count=6". $ git show-branch --merge-base master mhf misc finds the merge base of the three given heads. $ git show-branch master mhf misc shows logs from the top of these three branch heads, up to their common ancestor commit is shown. $ git show-branch --all --more=10 is poor-man's gitk, showing all the tags and heads, and going back 10 commits beyond the merge base of those refs. Signed-off-by: Junio C Hamano <junkio@cox.net>