1 /* Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
18 stash_open(struct view
*view
, enum open_flags flags
)
20 static const char *stash_argv
[] = { "git", "stash", "list",
21 encoding_arg
, "--no-color", "--pretty=raw", NULL
};
22 struct main_state
*state
= view
->private;
24 state
->with_graph
= FALSE
;
25 watch_register(&view
->watch
, WATCH_STASH
);
26 return begin_update(view
, NULL
, stash_argv
, flags
| OPEN_RELOAD
);
30 stash_select(struct view
*view
, struct line
*line
)
32 main_select(view
, line
);
33 string_format(view
->env
->stash
, "stash@{%d}", line
->lineno
- 1);
34 string_copy(view
->ref
, view
->env
->stash
);
37 static struct view_ops stash_ops
= {
40 VIEW_SEND_CHILD_ENTER
| VIEW_REFRESH
,
41 sizeof(struct main_state
),
49 view_column_bit(AUTHOR
) | view_column_bit(COMMIT_TITLE
) |
50 view_column_bit(DATE
) | view_column_bit(ID
) |
51 view_column_bit(LINE_NUMBER
),
57 /* vim: set ts=8 sw=8 noexpandtab: */