diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 8 | ||||
-rw-r--r-- | Documentation/git-branch.txt | 10 | ||||
-rw-r--r-- | Documentation/git-checkout.txt | 7 | ||||
-rw-r--r-- | Documentation/git-rev-parse.txt | 7 | ||||
-rw-r--r-- | Documentation/git-update-ref.txt | 28 | ||||
-rw-r--r-- | Documentation/repository-layout.txt | 11 |
6 files changed, 67 insertions, 4 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index cd56afd021..c861c6ce17 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -70,6 +70,14 @@ core.preferSymlinkRefs:: This is sometimes needed to work with old scripts that expect HEAD to be a symbolic link. +core.logAllRefUpdates:: + If true, `git-update-ref` will append a line to + "$GIT_DIR/logs/<ref>" listing the new SHA1 and the date/time + of the update. If the file does not exist it will be + created automatically. This information can be used to + determine what commit was the tip of a branch "2 days ago". + This value is false by default (no logging). + core.repositoryFormatVersion:: Internal variable identifying the repository format and layout version. diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 0b37e2bfc8..d43ef1dec4 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git-branch' [-r] -'git-branch' [-f] <branchname> [<start-point>] +'git-branch' [-l] [-f] <branchname> [<start-point>] 'git-branch' (-d | -D) <branchname>... DESCRIPTION @@ -23,7 +23,8 @@ If no <start-point> is given, the branch will be created with a head equal to that of the currently checked out branch. With a `-d` or `-D` option, `<branchname>` will be deleted. You may -specify more than one branch for deletion. +specify more than one branch for deletion. If the branch currently +has a ref log then the ref log will also be deleted. OPTIONS @@ -34,6 +35,11 @@ OPTIONS -D:: Delete a branch irrespective of its index status. +-l:: + Create the branch's ref log. This activates recording of + all changes to made the branch ref, enabling use of date + based sha1 expressions such as "<branchname>@{yesterday}". + -f:: Force the creation of a new branch even if it means deleting a branch that already exists with the same name. diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index d82efc00d4..fbdbadc74f 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -8,7 +8,7 @@ git-checkout - Checkout and switch to a branch SYNOPSIS -------- [verse] -'git-checkout' [-f] [-b <new_branch>] [-m] [<branch>] +'git-checkout' [-f] [-b <new_branch> [-l]] [-m] [<branch>] 'git-checkout' [-m] [<branch>] <paths>... DESCRIPTION @@ -40,6 +40,11 @@ OPTIONS by gitlink:git-check-ref-format[1]. Some of these checks may restrict the characters allowed in a branch name. +-l:: + Create the new branch's ref log. This activates recording of + all changes to made the branch ref, enabling use of date + based sha1 expressions such as "<branchname>@{yesterday}". + -m:: If you have local modifications to one or more files that are different between the current branch and the branch to diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index c4b0ff5842..627cde8520 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -124,6 +124,13 @@ syntax. happen to have both heads/master and tags/master, you can explicitly say 'heads/master' to tell git which one you mean. +* A suffix '@' followed by a date specification enclosed in a brace + pair (e.g. '\{yesterday\}', '\{1 month 2 weeks 3 days 1 hour 1 + second ago\}' or '\{1979-02-26 18:30:00\}') to specify the value + of the ref at a prior point in time. This suffix may only be + used immediately following a ref name and the ref must have an + existing log ($GIT_DIR/logs/<ref>). + * A suffix '{caret}' to a revision parameter means the first parent of that commit object. '{caret}<n>' means the <n>th parent (i.e. 'rev{caret}' diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt index 475237f19e..e062030e91 100644 --- a/Documentation/git-update-ref.txt +++ b/Documentation/git-update-ref.txt @@ -7,7 +7,7 @@ git-update-ref - update the object name stored in a ref safely SYNOPSIS -------- -'git-update-ref' <ref> <newvalue> [<oldvalue>] +'git-update-ref' [-m <reason>] <ref> <newvalue> [<oldvalue>] DESCRIPTION ----------- @@ -49,6 +49,32 @@ for reading but not for writing (so we'll never write through a ref symlink to some other tree, if you have copied a whole archive by creating a symlink tree). +Logging Updates +--------------- +If config parameter "core.logAllRefUpdates" is true or the file +"$GIT_DIR/logs/<ref>" exists then `git-update-ref` will append +a line to the log file "$GIT_DIR/logs/<ref>" (dereferencing all +symbolic refs before creating the log name) describing the change +in ref value. Log lines are formatted as: + + . oldsha1 SP newsha1 SP committer LF ++ +Where "oldsha1" is the 40 character hexadecimal value previously +stored in <ref>, "newsha1" is the 40 character hexadecimal value of +<newvalue> and "committer" is the committer's name, email address +and date in the standard GIT committer ident format. + +Optionally with -m: + + . oldsha1 SP newsha1 SP committer TAB message LF ++ +Where all fields are as described above and "message" is the +value supplied to the -m option. + +An update will fail (without changing <ref>) if the current user is +unable to create a new log file, append to the existing log file +or does not have committer information available. + Author ------ Written by Linus Torvalds <torvalds@osdl.org>. diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt index 98fbe7db52..b52dfdc308 100644 --- a/Documentation/repository-layout.txt +++ b/Documentation/repository-layout.txt @@ -128,3 +128,14 @@ remotes:: Stores shorthands to be used to give URL and default refnames to interact with remote repository to `git fetch`, `git pull` and `git push` commands. + +logs:: + Records of changes made to refs are stored in this + directory. See the documentation on git-update-ref + for more information. + +logs/refs/heads/`name`:: + Records all changes made to the branch tip named `name`. + +logs/refs/tags/`name`:: + Records all changes made to the tag named `name`. |