Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This merges the file listing in the directory cache index |
| 3 | * with the actual working directory list, and shows different |
| 4 | * combinations of the two. |
| 5 | * |
| 6 | * Copyright (C) Linus Torvalds, 2005 |
| 7 | */ |
| 8 | #include <dirent.h> |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 9 | #include <fnmatch.h> |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 10 | |
| 11 | #include "cache.h" |
| 12 | |
| 13 | static int show_deleted = 0; |
| 14 | static int show_cached = 0; |
| 15 | static int show_others = 0; |
| 16 | static int show_ignored = 0; |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 17 | static int show_stage = 0; |
Linus Torvalds | eec8c63 | 2005-04-16 12:43:32 -0700 | [diff] [blame] | 18 | static int show_unmerged = 0; |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 19 | static int show_killed = 0; |
Junio C Hamano | b83c834 | 2005-04-15 11:11:01 -0700 | [diff] [blame] | 20 | static int line_terminator = '\n'; |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 21 | |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 22 | static const char *tag_cached = ""; |
| 23 | static const char *tag_unmerged = ""; |
| 24 | static const char *tag_removed = ""; |
| 25 | static const char *tag_other = ""; |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 26 | static const char *tag_killed = ""; |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 27 | |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 28 | static int nr_excludes; |
| 29 | static const char **excludes; |
| 30 | static int excludes_alloc; |
| 31 | |
| 32 | static void add_exclude(const char *string) |
| 33 | { |
| 34 | if (nr_excludes == excludes_alloc) { |
| 35 | excludes_alloc = alloc_nr(excludes_alloc); |
| 36 | excludes = realloc(excludes, excludes_alloc*sizeof(char *)); |
| 37 | } |
| 38 | excludes[nr_excludes++] = string; |
| 39 | } |
| 40 | |
| 41 | static void add_excludes_from_file(const char *fname) |
| 42 | { |
| 43 | int fd, i; |
| 44 | long size; |
| 45 | char *buf, *entry; |
| 46 | |
| 47 | fd = open(fname, O_RDONLY); |
| 48 | if (fd < 0) |
| 49 | goto err; |
| 50 | size = lseek(fd, 0, SEEK_END); |
| 51 | if (size < 0) |
| 52 | goto err; |
| 53 | lseek(fd, 0, SEEK_SET); |
| 54 | if (size == 0) { |
| 55 | close(fd); |
| 56 | return; |
| 57 | } |
| 58 | buf = xmalloc(size); |
| 59 | if (read(fd, buf, size) != size) |
| 60 | goto err; |
| 61 | close(fd); |
| 62 | |
| 63 | entry = buf; |
| 64 | for (i = 0; i < size; i++) { |
| 65 | if (buf[i] == '\n') { |
| 66 | if (entry != buf + i) { |
| 67 | buf[i] = 0; |
| 68 | add_exclude(entry); |
| 69 | } |
| 70 | entry = buf + i + 1; |
| 71 | } |
| 72 | } |
| 73 | return; |
| 74 | |
| 75 | err: perror(fname); |
| 76 | exit(1); |
| 77 | } |
| 78 | |
| 79 | static int excluded(const char *pathname) |
| 80 | { |
| 81 | int i; |
| 82 | if (nr_excludes) { |
| 83 | const char *basename = strrchr(pathname, '/'); |
| 84 | basename = (basename) ? basename+1 : pathname; |
| 85 | for (i = 0; i < nr_excludes; i++) |
| 86 | if (fnmatch(excludes[i], basename, 0) == 0) |
| 87 | return 1; |
| 88 | } |
| 89 | return 0; |
| 90 | } |
| 91 | |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 92 | struct nond_on_fs { |
| 93 | int len; |
| 94 | char name[0]; |
| 95 | }; |
| 96 | |
| 97 | static struct nond_on_fs **dir; |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 98 | static int nr_dir; |
| 99 | static int dir_alloc; |
| 100 | |
| 101 | static void add_name(const char *pathname, int len) |
| 102 | { |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 103 | struct nond_on_fs *ent; |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 104 | |
| 105 | if (cache_name_pos(pathname, len) >= 0) |
| 106 | return; |
| 107 | |
| 108 | if (nr_dir == dir_alloc) { |
| 109 | dir_alloc = alloc_nr(dir_alloc); |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 110 | dir = xrealloc(dir, dir_alloc*sizeof(ent)); |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 111 | } |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 112 | ent = xmalloc(sizeof(*ent) + len + 1); |
| 113 | ent->len = len; |
| 114 | memcpy(ent->name, pathname, len); |
| 115 | dir[nr_dir++] = ent; |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | /* |
| 119 | * Read a directory tree. We currently ignore anything but |
Junio C Hamano | a15c1c6 | 2005-05-12 17:16:04 -0700 | [diff] [blame] | 120 | * directories, regular files and symlinks. That's because git |
| 121 | * doesn't handle them at all yet. Maybe that will change some |
| 122 | * day. |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 123 | * |
| 124 | * Also, we currently ignore all names starting with a dot. |
Ingo Molnar | aebb267 | 2005-04-12 11:36:26 -0700 | [diff] [blame] | 125 | * That likely will not change. |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 126 | */ |
| 127 | static void read_directory(const char *path, const char *base, int baselen) |
| 128 | { |
| 129 | DIR *dir = opendir(path); |
| 130 | |
| 131 | if (dir) { |
| 132 | struct dirent *de; |
| 133 | char fullname[MAXPATHLEN + 1]; |
| 134 | memcpy(fullname, base, baselen); |
| 135 | |
| 136 | while ((de = readdir(dir)) != NULL) { |
| 137 | int len; |
| 138 | |
Junio C Hamano | c4ee295 | 2005-05-24 18:20:08 -0700 | [diff] [blame] | 139 | if ((de->d_name[0] == '.') && |
| 140 | (de->d_name[1] == 0 || |
| 141 | !strcmp(de->d_name + 1, ".") || |
| 142 | !strcmp(de->d_name + 1, "git"))) |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 143 | continue; |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 144 | if (excluded(de->d_name) != show_ignored) |
| 145 | continue; |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 146 | len = strlen(de->d_name); |
| 147 | memcpy(fullname + baselen, de->d_name, len+1); |
| 148 | |
Edgar Toernig | b682969 | 2005-04-30 09:51:03 -0700 | [diff] [blame] | 149 | switch (DTYPE(de)) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 150 | struct stat st; |
| 151 | default: |
| 152 | continue; |
| 153 | case DT_UNKNOWN: |
| 154 | if (lstat(fullname, &st)) |
| 155 | continue; |
Junio C Hamano | a15c1c6 | 2005-05-12 17:16:04 -0700 | [diff] [blame] | 156 | if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 157 | break; |
| 158 | if (!S_ISDIR(st.st_mode)) |
| 159 | continue; |
| 160 | /* fallthrough */ |
| 161 | case DT_DIR: |
| 162 | memcpy(fullname + baselen + len, "/", 2); |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 163 | read_directory(fullname, fullname, |
| 164 | baselen + len + 1); |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 165 | continue; |
| 166 | case DT_REG: |
Junio C Hamano | a15c1c6 | 2005-05-12 17:16:04 -0700 | [diff] [blame] | 167 | case DT_LNK: |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 168 | break; |
| 169 | } |
| 170 | add_name(fullname, baselen + len); |
| 171 | } |
| 172 | closedir(dir); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | static int cmp_name(const void *p1, const void *p2) |
| 177 | { |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 178 | const struct nond_on_fs *e1 = *(const struct nond_on_fs **)p1; |
| 179 | const struct nond_on_fs *e2 = *(const struct nond_on_fs **)p2; |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 180 | |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 181 | return cache_name_compare(e1->name, e1->len, |
| 182 | e2->name, e2->len); |
| 183 | } |
| 184 | |
Linus Torvalds | e99d59f | 2005-05-20 11:46:10 -0700 | [diff] [blame] | 185 | static void show_killed_files(void) |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 186 | { |
| 187 | int i; |
| 188 | for (i = 0; i < nr_dir; i++) { |
| 189 | struct nond_on_fs *ent = dir[i]; |
| 190 | char *cp, *sp; |
| 191 | int pos, len, killed = 0; |
| 192 | |
| 193 | for (cp = ent->name; cp - ent->name < ent->len; cp = sp + 1) { |
| 194 | sp = strchr(cp, '/'); |
| 195 | if (!sp) { |
| 196 | /* If ent->name is prefix of an entry in the |
| 197 | * cache, it will be killed. |
| 198 | */ |
| 199 | pos = cache_name_pos(ent->name, ent->len); |
| 200 | if (0 <= pos) |
| 201 | die("bug in show-killed-files"); |
| 202 | pos = -pos - 1; |
| 203 | while (pos < active_nr && |
| 204 | ce_stage(active_cache[pos])) |
| 205 | pos++; /* skip unmerged */ |
| 206 | if (active_nr <= pos) |
| 207 | break; |
| 208 | /* pos points at a name immediately after |
| 209 | * ent->name in the cache. Does it expect |
| 210 | * ent->name to be a directory? |
| 211 | */ |
| 212 | len = ce_namelen(active_cache[pos]); |
| 213 | if ((ent->len < len) && |
| 214 | !strncmp(active_cache[pos]->name, |
| 215 | ent->name, ent->len) && |
| 216 | active_cache[pos]->name[ent->len] == '/') |
| 217 | killed = 1; |
| 218 | break; |
| 219 | } |
| 220 | if (0 <= cache_name_pos(ent->name, sp - ent->name)) { |
| 221 | /* If any of the leading directories in |
| 222 | * ent->name is registered in the cache, |
| 223 | * ent->name will be killed. |
| 224 | */ |
| 225 | killed = 1; |
| 226 | break; |
| 227 | } |
| 228 | } |
| 229 | if (killed) |
| 230 | printf("%s%.*s%c", tag_killed, |
| 231 | dir[i]->len, dir[i]->name, |
| 232 | line_terminator); |
| 233 | } |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | static void show_files(void) |
| 237 | { |
| 238 | int i; |
| 239 | |
| 240 | /* For cached/deleted files we don't need to even do the readdir */ |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 241 | if (show_others || show_killed) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 242 | read_directory(".", "", 0); |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 243 | qsort(dir, nr_dir, sizeof(struct nond_on_fs *), cmp_name); |
| 244 | if (show_others) |
| 245 | for (i = 0; i < nr_dir; i++) |
| 246 | printf("%s%.*s%c", tag_other, |
| 247 | dir[i]->len, dir[i]->name, |
| 248 | line_terminator); |
| 249 | if (show_killed) |
| 250 | show_killed_files(); |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 251 | } |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 252 | if (show_cached | show_stage) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 253 | for (i = 0; i < active_nr; i++) { |
| 254 | struct cache_entry *ce = active_cache[i]; |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 255 | if (excluded(ce->name) != show_ignored) |
| 256 | continue; |
Linus Torvalds | eec8c63 | 2005-04-16 12:43:32 -0700 | [diff] [blame] | 257 | if (show_unmerged && !ce_stage(ce)) |
| 258 | continue; |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 259 | if (!show_stage) |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 260 | printf("%s%s%c", |
| 261 | ce_stage(ce) ? tag_unmerged : |
| 262 | tag_cached, |
| 263 | ce->name, line_terminator); |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 264 | else |
Junio C Hamano | 2eab945 | 2005-05-26 14:38:19 -0700 | [diff] [blame] | 265 | printf("%s%06o %s %d\t%s%c", |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 266 | ce_stage(ce) ? tag_unmerged : |
| 267 | tag_cached, |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 268 | ntohl(ce->ce_mode), |
| 269 | sha1_to_hex(ce->sha1), |
| 270 | ce_stage(ce), |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 271 | ce->name, line_terminator); |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 272 | } |
| 273 | } |
| 274 | if (show_deleted) { |
| 275 | for (i = 0; i < active_nr; i++) { |
| 276 | struct cache_entry *ce = active_cache[i]; |
| 277 | struct stat st; |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 278 | if (excluded(ce->name) != show_ignored) |
| 279 | continue; |
Kay Sievers | 8ae0a8c | 2005-05-05 14:38:25 +0200 | [diff] [blame] | 280 | if (!lstat(ce->name, &st)) |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 281 | continue; |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 282 | printf("%s%s%c", tag_removed, ce->name, |
| 283 | line_terminator); |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 284 | } |
| 285 | } |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 286 | } |
| 287 | |
Nicolas Pitre | 1771039 | 2005-04-30 13:59:38 -0700 | [diff] [blame] | 288 | static const char *ls_files_usage = |
Alexey Nezhdanov | 667bb59 | 2005-05-19 15:17:16 +0400 | [diff] [blame] | 289 | "git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed])* " |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 290 | "[ --ignored [--exclude=<pattern>] [--exclude-from=<file>) ]"; |
| 291 | |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 292 | int main(int argc, char **argv) |
| 293 | { |
| 294 | int i; |
| 295 | |
| 296 | for (i = 1; i < argc; i++) { |
| 297 | char *arg = argv[i]; |
| 298 | |
Junio C Hamano | b83c834 | 2005-04-15 11:11:01 -0700 | [diff] [blame] | 299 | if (!strcmp(arg, "-z")) { |
| 300 | line_terminator = 0; |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 301 | } else if (!strcmp(arg, "-t")) { |
| 302 | tag_cached = "H "; |
| 303 | tag_unmerged = "M "; |
| 304 | tag_removed = "R "; |
| 305 | tag_other = "? "; |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 306 | tag_killed = "K "; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 307 | } else if (!strcmp(arg, "-c") || !strcmp(arg, "--cached")) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 308 | show_cached = 1; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 309 | } else if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 310 | show_deleted = 1; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 311 | } else if (!strcmp(arg, "-o") || !strcmp(arg, "--others")) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 312 | show_others = 1; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 313 | } else if (!strcmp(arg, "-i") || !strcmp(arg, "--ignored")) { |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 314 | show_ignored = 1; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 315 | } else if (!strcmp(arg, "-s") || !strcmp(arg, "--stage")) { |
Junio C Hamano | aee4619 | 2005-04-16 08:33:23 -0700 | [diff] [blame] | 316 | show_stage = 1; |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 317 | } else if (!strcmp(arg, "-k") || !strcmp(arg, "--killed")) { |
| 318 | show_killed = 1; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 319 | } else if (!strcmp(arg, "-u") || !strcmp(arg, "--unmerged")) { |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 320 | /* There's no point in showing unmerged unless |
| 321 | * you also show the stage information. |
| 322 | */ |
Linus Torvalds | eec8c63 | 2005-04-16 12:43:32 -0700 | [diff] [blame] | 323 | show_stage = 1; |
| 324 | show_unmerged = 1; |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 325 | } else if (!strcmp(arg, "-x") && i+1 < argc) { |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 326 | add_exclude(argv[++i]); |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 327 | } else if (!strncmp(arg, "--exclude=", 10)) { |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 328 | add_exclude(arg+10); |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 329 | } else if (!strcmp(arg, "-X") && i+1 < argc) { |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 330 | add_excludes_from_file(argv[++i]); |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 331 | } else if (!strncmp(arg, "--exclude-from=", 15)) { |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 332 | add_excludes_from_file(arg+15); |
Nicolas Pitre | cf9a113 | 2005-04-28 15:06:25 -0700 | [diff] [blame] | 333 | } else |
Nicolas Pitre | 1771039 | 2005-04-30 13:59:38 -0700 | [diff] [blame] | 334 | usage(ls_files_usage); |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | if (show_ignored && !nr_excludes) { |
Petr Baudis | 20d37ef | 2005-04-21 19:47:08 -0700 | [diff] [blame] | 338 | fprintf(stderr, "%s: --ignored needs some exclude pattern\n", |
| 339 | argv[0]); |
Nicolas Pitre | 9ff768e | 2005-04-28 11:44:04 -0700 | [diff] [blame] | 340 | exit(1); |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | /* With no flags, we default to showing the cached files */ |
Junio C Hamano | 6ca4594 | 2005-05-12 17:17:54 -0700 | [diff] [blame] | 344 | if (!(show_stage | show_deleted | show_others | show_unmerged | show_killed)) |
Linus Torvalds | 8695c8b | 2005-04-11 18:55:38 -0700 | [diff] [blame] | 345 | show_cached = 1; |
| 346 | |
| 347 | read_cache(); |
| 348 | show_files(); |
| 349 | return 0; |
| 350 | } |