aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* GIT v1.5.0-rc1v1.5.0-rc1Junio C Hamano2007-01-11
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* plug a few leaks in revision walking used in describe.Junio C Hamano2007-01-11
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Chose better tag names in git-describe after merges.Shawn O. Pearce2007-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently git.git itself encountered a situation on its master and next branches where git-describe stopped reporting 'v1.5.0-rc0-gN' and instead started reporting 'v1.4.4.4-gN'. This appeared to be a backward jump in version numbering. maint o-------------------4 \ \ master o-o-o-o-o-o-o-5-o-C-o-W The issue is that commit C in the diagram claims it is version 1.5.0, as the tag v1.5.0 is placed on commit 5. Yet commit W claims it is version 1.4.4.4 as the tag v1.5.0 has an older tag date than the v1.4.4.4 tag. As it turns out this situation is very common. A bug fix applied to maint and later merged into master occurs frequently enough that it should Just Work Right(tm). Rather than taking the first tag that gets found git-describe will now generate a list of all possible tags and select the one which has the most number of commits in common with HEAD (or whatever revision the user requested the description of). This rule is based on the principle shown in the diagram above. There are a large number of commits on the primary development branch 'master' which do not appear in the 'maint' branch, and many of these are already tagged as part of v1.5.0-rc0. Additionally these commits are not in v1.4.4.4, as they are part of the v1.5.0 release still being developed. The v1.5.0-rc0 tag is more descriptive of W than v1.4.4.4 is, and therefore should be used. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/bare'Junio C Hamano2007-01-11
|\ | | | | | | | | | | | | | | * jc/bare: Disallow working directory commands in a bare repository. git-fetch: allow updating the current branch in a bare repository. Introduce is_bare_repository() and core.bare configuration variable Move initialization of log_all_ref_updates
| * Disallow working directory commands in a bare repository.Shawn O. Pearce2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user tries to run a porcelainish command which requires a working directory in a bare repository they may get unexpected results which are difficult to predict and may differ from command to command. Instead we should detect that the current repository is a bare repository and refuse to run the command there, as there is no working directory associated with it. [jc: updated Shawn's original somewhat -- bugs are mine.] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-fetch: allow updating the current branch in a bare repository.Junio C Hamano2007-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, people have only fetch access into a bare repository that is used as a back-up location (or a distribution point) but does not have a push access for networking reasons, e.g. one end being behind a firewall, and updating the "current branch" in such a case is perfectly fine. This allows such a fetch without --update-head-ok, which is a flag that should never be used by end users otherwise. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Introduce is_bare_repository() and core.bare configuration variableJunio C Hamano2007-01-07
| | | | | | | | | | | | | | | | | | | | | | This removes the old is_bare_git_dir(const char *) to ask if a directory, if it is a GIT_DIR, is a bare repository, and replaces it with is_bare_repository(void *). The function looks at core.bare configuration variable if exists but uses the old heuristics: if it is ".git" or ends with "/.git", then it does not look like a bare repository, otherwise it does. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Move initialization of log_all_ref_updatesJunio C Hamano2007-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patches to prevent Porcelainish that require working tree from doing any damage in a bare repository make a lot of sense, and I want to make the is_bare_git_dir() function more reliable. In order to allow the repository owner override the heuristic implemented in is_bare_git_dir() if/when it misidentifies a particular repository, it would make sense to introduce a new configuration variable "[core] bare = true/false", and make is_bare_git_dir() notice it. The scripts would do a 'repo-config --bool --get core.bare' and iff the command fails (i.e. there is no such variable in the configuration file), it would use the heuristic implemented at the script level [*1*]. However, setup_git_env() which is called a lot earlier than we even read from the repository configuration currently makes a call to is_bare_git_dir(), in order to change the default setting for log_all_ref_updates. It somehow feels that this is a hack. By the way, [*1*] is another thing I hate about the current config mechanism. "git-repo-config --get" does not know what the possible configuration variables are, let alone what the default values for them are. It allows us not to maintain a centralized configuration table, which makes it easy to introduce ad-hoc variables and gives a warm fuzzy feeling of being modular, but my feeling is that it is turning out to be a rather high price to pay for scripts. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'ar/merge-recursive'Junio C Hamano2007-01-11
|\ \ | | | | | | | | | | | | | | | * ar/merge-recursive: merge-recursive: do not use on-file index when not needed. Speed-up recursive by flushing index only once for all entries
| * | merge-recursive: do not use on-file index when not needed.Junio C Hamano2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This revamps the merge-recursive implementation following the outline in: Message-ID: <7v8xgileza.fsf@assigned-by-dhcp.cox.net> There is no need to write out the index until the very end just once from merge-recursive. Also there is no need to write out the resulting tree object for the simple case of merging with a single merge base. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Speed-up recursive by flushing index only once for all entriesAlex Riesen2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge-recursive implementation in C inherited the invariant that the on-file index file is written out and later read back after any index operations and writing trees from the original Python implementation. But it was only because the original implementation worked at the scripting level. There is no need to write out the index file after handling every path. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'jc/detached-head'Junio C Hamano2007-01-11
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/detached-head: git-checkout: handle local changes sanely when detaching HEAD git-checkout: safety check for detached HEAD checks existing refs git-checkout: fix branch name output from the command git-checkout: safety when coming back from the detached HEAD state. git-checkout: rewording comments regarding detached HEAD. git-checkout: do not warn detaching HEAD when it is already detached. Detached HEAD (experimental) git-branch: show detached HEAD git-status: show detached HEAD
| * | | git-checkout: handle local changes sanely when detaching HEADJunio C Hamano2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When switching branches, we usually first try read-tree to make sure that we do not lose the local changes and then updated the HEAD using update-ref. However, we detached and updated HEAD before these checks, which was quite bad in a repository with local changes. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-checkout: safety check for detached HEAD checks existing refsJunio C Hamano2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking for reachability from refs does not help much if the state we are currently on is somewhere in the middle. We will lose where we were. So this makes sureh that HEAD is something directly pointed at by one of the existing refs (most likely a tag for a user who has been "sightseeing"). Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-checkout: fix branch name output from the commandJunio C Hamano2007-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When switching branches with "git checkout", we internally did $arg^0 (aka $arg^{commit}) suffix but there was no need to. The improvement is easily visible in the change to an existing test t/3200-branch.sh in this commit; it was expecting rather ugly message. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-checkout: safety when coming back from the detached HEAD state.Junio C Hamano2007-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After making commits in the detached HEAD state, if you run "git checkout" to switch to an existing branch, you will lose your work. Make sure the switched-to branch is a fast-forward of the current HEAD, or require -f when switching. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-checkout: rewording comments regarding detached HEAD.Junio C Hamano2007-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to say "you are not on a branch" before the initial commit. This is incorrect -- the user is on a branch yet to be born, but its name has been already determined. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-checkout: do not warn detaching HEAD when it is already detached.Junio C Hamano2007-01-08
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Detached HEAD (experimental)Junio C Hamano2007-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows "git checkout v1.4.3" to dissociate the HEAD of repository from any branch. After this point, "git branch" starts reporting that you are not on any branch. You can go back to an existing branch by saying "git checkout master", for example. This is still experimental. While I think it makes sense to allow commits on top of detached HEAD, it is rather dangerous unless you are careful in the current form. Next "git checkout master" will obviously lose what you have done, so we might want to require "git checkout -f" out of a detached HEAD if we find that the HEAD commit is not an ancestor of any other branches. There is no such safety valve implemented right now. On the other hand, the reason the user did not start the ad-hoc work on a new branch with "git checkout -b" was probably because the work was of a throw-away nature, so the convenience of not having that safety valve might be even better. The user, after accumulating some commits on top of a detached HEAD, can always create a new branch with "git checkout -b" not to lose useful work done while the HEAD was detached. We'll see. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-branch: show detached HEADLars Hjemli2007-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes git-branch show a detached HEAD as '* (no branch)'. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-status: show detached HEADJunio C Hamano2007-01-08
| | | | | | | | | | | | | | | | | | | | | | | | This makes git-status to state when you are not on any branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git-status: wording update to deal with deleted files.Junio C Hamano2007-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you do: $ /bin/rm foo $ git status we used to say "git add ... to add content to commit". But suggsting "git add" to record the deletion of a file is simply insane. So this rewords various things: - The section header is the old "Changed but not updated", instead of "Changed but not added"; - Suggestion is "git add ... to update what will be committed", instead of "... to add content to commit"; - If there are removed paths, the above suggestion becomes "git add/rm ... to update what will be committed"; - For untracked files, the suggestion is "git add ... to include in what will be committed". Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git-rm: do not fail on already removed file.Junio C Hamano2007-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Often the user would do "/bin/rm foo" before telling git, but then want to tell git about it. "git rm foo" however would fail because it cannot unlink(2) foo. Treat ENOENT error return from unlink(2) as if a successful removal happened. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Avoid errors and warnings when attempting to do I/O on zero bytesEric Wong2007-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, while {read,write}_in_full do take into account zero-sized reads/writes; their die and whine variants do not. I have a repository where there are zero-sized files in the history that was triggering these things. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Better error messages for corrupt databasesLinus Torvalds2007-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes another problem that Andy's case showed: git-fsck-objects reports nonsensical results for corrupt objects. There were actually two independent and confusing problems: - when we had a zero-sized file and used map_sha1_file, mmap() would return EINVAL, and git-fsck-objects would report that as an insane and confusing error. I don't know when this was introduced, it might have been there forever. - when "parse_object()" returned NULL, fsck would say "object not found", which can be very confusing, since obviously the object might "exist", it's just unparseable because it's totally corrupt. So this just makes "xmmap()" return NULL for a zero-sized object (which is a valid thing pointer, exactly the same way "malloc()" can return NULL for a zero-sized allocation). That fixes the first problem (but we could have fixed it in the caller too - I don't personally much care whichever way it goes, but maybe somebody should check that the NO_MMAP case does something sane in this case too?). And the second problem is solved by just making the error message slightly clearer - the failure to parse an object may be because it's missing or corrupt, not necessarily because it's not "found". Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | config-set: check write-in-full returns in set_multivarJunio C Hamano2007-01-11
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | index-pack: write-or-die instead of unchecked write-in-full.Junio C Hamano2007-01-11
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | write_in_full: really write in full or return error on disk full.Linus Torvalds2007-01-11
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Document git-initJunio C Hamano2007-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These days, the command does a lot more than just initialise the object database (such as setting default config-variables, installing template hooks...), and "git init" is actually a more sensible name nowadays. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | write-cache: do not leak the serialized cache-tree data.Linus Torvalds2007-01-11
| |/ / |/| | | | | | | | | | | | | | | | | It is not used after getting written, and just is leaking every time we write the index out. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Provide better feedback for the untracked only case in status outputJürgen Rühle2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 98bf8a47c296f51ea9722fef4bb81dbfb70cd4bb status would claim that git-commit could be useful even if there are no changes except untracked files. Since wt-status is already computing all the information needed go the whole way and actually track the (non-)emptiness of all three sections separately, unify the code, and provide useful messages for each individual case. Thanks to Junio and Michael Loeffler for suggestions. Signed-off-by: Jürgen Rühle <j-r@online.de>
* | | Merge branch 'js/reflog'Junio C Hamano2007-01-10
|\ \ \ | | | | | | | | | | | | | | | | * js/reflog: Sanitize for_each_reflog_ent()
| * | | Sanitize for_each_reflog_ent()Johannes Schindelin2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It used to ignore the return value of the helper function; now, it expects it to return 0, and stops iteration upon non-zero return values; this value is then passed on as the return value of for_each_reflog_ent(). Further, it makes no sense to force the parsing upon the helper functions; for_each_reflog_ent() now calls the helper function with old and new sha1, the email, the timestamp & timezone, and the message. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Makefile: remove $foo when $foo.exe is built/installed.Junio C Hamano2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Cygwin, newly builtins are not recognized, because there exist both the executable binaries (with .exe extension) _and_ the now-obsolete scripts (without extension), but the script is executed. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | send-email: work around double encoding of in-body From field.Jürgen Rühle2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-send-email sends out the message taken from format-patch output without quoting nor encoding. When copying the From: line to form in-body From: field, it should not copy it verbatim, because the From: for the header is quoted according to RFC 2047 when not ASCII. The original came from Jürgen Rühle, but I moved the string munging into a separate function so that later other people can tweak it more easily. Bugs introduced during the translation are mine. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Add git-init documentation.Nicolas Pitre2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops. Commit 515377ea9ec6192f82a2fa5c5b5b7651d9d6cf6c missed one file, git-init documentation. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Fix t1410 for core.filemode==falseJohannes Schindelin2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since c869753e, core.filemode is hardwired to false on Cygwin. So this test had no chance to succeed, since an early commit (changing just the filemode) failed, and therefore all subsequent tests. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Make git-describe a builtin.Shawn O. Pearce2007-01-10
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Don't save the commit buffer in git-describe.Shawn O. Pearce2007-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit buffer (message of the commit) is not actually used by the git-describe process. We can save some memory by not keeping it around. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Fix warnings in sha1_file.c - use C99 printf format if availablePavel Roskin2007-01-09
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | -u is now default for 'git-mailinfo'.Junio C Hamano2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally from David Woodhouse, but also adjusts the callers of mailinfo to the new default. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | -u is now default for 'git-applymbox'Junio C Hamano2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It has '-n' to disable it just in case, but do not even bother documenting it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git-am: should work when "--no-utf8 --utf8" is givenJunio C Hamano2007-01-09
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Don't die in git-http-fetch when fetching packs.Shawn O. Pearce2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My sp/mmap changes to pack-check.c modified the function such that it expects packed_git.pack_size to be populated with the total bytecount of the packfile by the caller. But that isn't the case for packs obtained by git-http-fetch as pack_size was not initialized before being accessed. This caused verify_pack to think it had 2^32-21 bytes available when the downloaded pack perhaps was only 305 bytes in length. The use_pack function then later dies with "offset beyond end of packfile" when computing the overall file checksum. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Update git-svn manpage to remove the implication that SVN::* is optional.Steven Grimm2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that git-svn requires the SVN::* Perl library, the manpage doesn't need to describe what happens when you don't have it. Signed-off-by: Steven Grimm <koreth@midwinter.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Replacing the system call pread() with lseek()/xread()/lseek() sequence.Stefan-W. Hahn2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using cygwin with cygwin.dll before 1.5.22 the system call pread() is buggy. This patch introduces NO_PREAD. If NO_PREAD is set git uses a sequence of lseek()/xread()/lseek() to emulate pread. Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | gitweb: Fix git_patchset_body not closing <div class="patch">Jakub Narebski2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix case when git_patchset_body didn't close <div class="patch">, for patchsets with last patch empty. This patch also removes some commented out code in git_patchset_body. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git.el: Define the propertize function if needed, for XEmacs compatibility.Alexandre Julliard2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use `concat' instead of `format' in the pretty-printer since format doesn't preserve properties under XEmacs. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git-clone: Make sure the master branch exists before running cat on it.Alexandre Julliard2007-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we get an error like this on stderr: cat: [...]/.git/refs/remotes/origin/master: No such file or directory which makes it look like git-clone failed. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git-apply: Remove directories that have become empty after deleting a file.Alexandre Julliard2007-01-09
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>