--stdin::
In addition to the '<commit>' listed on the command
- line, read them from the standard input. If a '--' separator is
+ line, read them from the standard input. If a `--` separator is
seen, stop reading commits and start reading paths to limit the
result.
+
With `--pretty` format other than `oneline` (for obvious reasons),
this causes the output to have two extra lines of information
- taken from the reflog. By default, 'commit@\{Nth}' notation is
- used in the output. When the starting commit is specified as
- 'commit@\{now}', output also uses 'commit@\{timestamp}' notation
- instead. Under `--pretty=oneline`, the commit message is
+ taken from the reflog. The reflog designator in the output may be shown
+ as `ref@{Nth}` (where `Nth` is the reverse-chronological index in the
+ reflog) or as `ref@{timestamp}` (with the timestamp for that entry),
+ depending on a few rules:
+ +
+ --
+ 1. If the starting point is specified as `ref@{Nth}`, show the index
+ format.
+ +
+ 2. If the starting point was specified as `ref@{now}`, show the
+ timestamp format.
+ +
+ 3. If neither was used, but `--date` was given on the command line, show
+ the timestamp in the format requested by `--date`.
+ +
+ 4. Otherwise, show the index format.
+ --
+ +
+ Under `--pretty=oneline`, the commit message is
prefixed with this information on the same line.
This option cannot be combined with `--reverse`.
See also linkgit:git-reflog[1].
`iso-local`), the user's local time zone is used instead.
+
`--date=relative` shows dates relative to the current time,
- e.g. ``2 hours ago''. The `-local` option cannot be used with
- `--raw` or `--relative`.
+ e.g. ``2 hours ago''. The `-local` option has no effect for
+ `--date=relative`.
+
`--date=local` is an alias for `--date=default-local`.
+
+
`--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.
+
- `--date=raw` shows the date in the internal raw Git format `%s %z` format.
+ `--date=raw` shows the date as seconds since the epoch (1970-01-01
+ 00:00:00 UTC), followed by a space, and then the timezone as an offset
+ from UTC (a `+` or `-` with four digits; the first two are hours, and
+ the second two are minutes). I.e., as if the timestamp were formatted
+ with `strftime("%s %z")`).
+ Note that the `-local` option does not affect the seconds-since-epoch
+ value (which is always measured in UTC), but does switch the accompanying
+ timezone value.
+ +
+ `--date=unix` shows the date as a Unix epoch timestamp (seconds since
+ 1970). As with `--raw`, this is always in UTC and therefore `-local`
+ has no effect.
+
`--date=format:...` feeds the format `...` to your system `strftime`.
Use `--date=format:%c` to show the date in your system locale's
int blamed_lines;
};
-static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b, long ctxlen,
+static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b,
xdl_emit_hunk_consume_func_t hunk_func, void *cb_data)
{
xpparam_t xpp = {0};
xdemitcb_t ecb = {NULL};
xpp.flags = xdl_opts;
- xecfg.ctxlen = ctxlen;
xecfg.hunk_func = hunk_func;
ecb.priv = cb_data;
return xdi_diff(file_a, file_b, &xpp, &xecfg, &ecb);
fill_origin_blob(&sb->revs->diffopt, target, &file_o);
num_get_patch++;
- if (diff_hunks(&file_p, &file_o, 0, blame_chunk_cb, &d))
+ if (diff_hunks(&file_p, &file_o, blame_chunk_cb, &d))
die("unable to generate diff (%s -> %s)",
oid_to_hex(&parent->commit->object.oid),
oid_to_hex(&target->commit->object.oid));
* file_p partially may match that image.
*/
memset(split, 0, sizeof(struct blame_entry [3]));
- if (diff_hunks(file_p, &file_o, 1, handle_split_cb, &d))
+ if (diff_hunks(file_p, &file_o, handle_split_cb, &d))
die("unable to generate diff (%s)",
oid_to_hex(&parent->commit->object.oid));
/* remainder, if any, all match the preimage */
static void verify_working_tree_path(struct commit *work_tree, const char *path)
{
struct commit_list *parents;
+ int pos;
for (parents = work_tree->parents; parents; parents = parents->next) {
const unsigned char *commit_sha1 = parents->item->object.oid.hash;
sha1_object_info(blob_sha1, NULL) == OBJ_BLOB)
return;
}
- die("no such path '%s' in HEAD", path);
+
+ pos = cache_name_pos(path, strlen(path));
+ if (pos >= 0)
+ ; /* path is in the index */
+ else if (!strcmp(active_cache[-1 - pos]->name, path))
+ ; /* path is in the index, unmerged */
+ else
+ die("no such path '%s' in HEAD", path);
}
static struct commit_list **append_parent(struct commit_list **tail, const unsigned char *sha1)
case DATE_RAW:
blame_date_width = sizeof("1161298804 -0700");
break;
+ case DATE_UNIX:
+ blame_date_width = sizeof("1161298804");
+ break;
case DATE_SHORT:
blame_date_width = sizeof("2006-10-19");
break;
#define REFRESH_IGNORE_SUBMODULES 0x0010 /* ignore submodules */
#define REFRESH_IN_PORCELAIN 0x0020 /* user friendly output, not "needs update" */
extern int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
+extern struct cache_entry *refresh_cache_entry(struct cache_entry *, unsigned int);
extern void update_index_if_able(struct index_state *, struct lock_file *);
DATE_ISO8601_STRICT,
DATE_RFC2822,
DATE_STRFTIME,
- DATE_RAW
+ DATE_RAW,
+ DATE_UNIX
} type;
const char *strftime_fmt;
int local;
extern const char *git_editor(void);
extern const char *git_pager(int stdout_is_tty);
extern int git_ident_config(const char *, const char *, void *);
+extern void reset_ident_date(void);
struct ident_split {
const char *name_begin;
/* Request */
enum object_type *typep;
unsigned long *sizep;
- unsigned long *disk_sizep;
+ off_t *disk_sizep;
unsigned char *delta_base_sha1;
struct strbuf *typename;
extern int copy_file_with_time(const char *dst, const char *src, int mode);
extern void write_or_die(int fd, const void *buf, size_t count);
-extern int write_or_whine(int fd, const void *buf, size_t count, const char *msg);
extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg);
extern void fsync_or_die(int fd, const char *);