summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 915e5b7)
raw | patch | inline | side by side (parent: 915e5b7)
author | jipey <jipeye@gmail.com> | |
Mon, 29 Mar 2010 02:49:08 +0000 (22:49 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 30 Mar 2010 11:29:30 +0000 (07:29 -0400) |
This makes it possible to easily change branches from the branch view.
[ jf: updated docs, added NEWS entry, added checkout run request ]
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
[ jf: updated docs, added NEWS entry, added checkout run request ]
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
NEWS | patch | blob | history | |
manual.txt | patch | blob | history | |
tig.c | patch | blob | history | |
tigrc.5.txt | patch | blob | history |
index 07198d3a3452a3faec38a23487def126f9219258..bce72ebf7fd085e3523290c6c8502ba471d8e17a 100644 (file)
--- a/NEWS
+++ b/NEWS
- Status view: update the file variable when a line is selected so
%(file) works as expected.
+ - Branch view: add %(branch) symbol providing access to the selected
+ branch.
- Branch view: add entry to browse all branches (uses git-log's --all
flag).
- Abbreviation of author names can now be configured and toggled.
diff --git a/manual.txt b/manual.txt
index 5fd9c510723e905c99e87705c4ed4e3f7e933ae9..cfc26c67840b68d5054767f2b12a11375a228cb3 100644 (file)
--- a/manual.txt
+++ b/manual.txt
|%(head) |The currently viewed 'head' ID. Defaults to HEAD
|%(commit) |The currently selected commit ID.
|%(blob) |The currently selected blob ID.
+|%(branch) |The currently selected branch name.
|%(directory) |The current directory path in the tree view;
empty for the root directory.
|%(file) |The currently selected file.
index 826c3f9be45a5d907f0d5e26a7fd89c94c89de6a..c8ab944dd804192c6f37344fc24d4f19726d7d05 100644 (file)
--- a/tig.c
+++ b/tig.c
add_builtin_run_requests(void)
{
const char *cherry_pick[] = { "git", "cherry-pick", "%(commit)", NULL };
+ const char *checkout[] = { "git", "checkout", "%(branch)", NULL };
const char *commit[] = { "git", "commit", NULL };
const char *gc[] = { "git", "gc", NULL };
struct {
} reqs[] = {
{ KEYMAP_MAIN, 'C', ARRAY_SIZE(cherry_pick) - 1, cherry_pick },
{ KEYMAP_STATUS, 'C', ARRAY_SIZE(commit) - 1, commit },
+ { KEYMAP_BRANCH, 'C', ARRAY_SIZE(checkout) - 1, checkout },
{ KEYMAP_GENERIC, 'G', ARRAY_SIZE(gc) - 1, gc },
};
int i;
static char ref_blob[SIZEOF_REF] = "";
static char ref_commit[SIZEOF_REF] = "HEAD";
static char ref_head[SIZEOF_REF] = "HEAD";
+static char ref_branch[SIZEOF_REF] = "";
struct view {
const char *name; /* View name */
FORMAT_VAR("%(head)", ref_head, ""),
FORMAT_VAR("%(commit)", ref_commit, ""),
FORMAT_VAR("%(blob)", ref_blob, ""),
+ FORMAT_VAR("%(branch)", ref_branch, ""),
};
int i;
string_copy_rev(view->ref, branch->ref->id);
string_copy_rev(ref_commit, branch->ref->id);
string_copy_rev(ref_head, branch->ref->id);
+ string_copy_rev(ref_branch, branch->ref->name);
}
static struct view_ops branch_ops = {
diff --git a/tigrc.5.txt b/tigrc.5.txt
index d33056a4f52013efd88a69413de534873a96faef..575164e96065515259b817026d12d45c984f5614 100644 (file)
--- a/tigrc.5.txt
+++ b/tigrc.5.txt
|%(head) |The currently viewed 'head' ID. Defaults to HEAD
|%(commit) |The currently selected commit ID.
|%(blob) |The currently selected blob ID.
+|%(branch) |The currently selected branch name.
|%(directory) |The current directory path in the tree view;
empty for the root directory.
|%(file) |The currently selected file.