aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Assorted typo fixesPavel Roskin2007-02-03
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Cleanup subcommand documentation for git-remote.Shawn O. Pearce2007-02-03
| | | | | | | | | | Jakub Narebski pointed out the positional notation in git-remote's documentation was very confusing, especially now that we have 3 supported subcommands. Instead of referring to subcommands by position, refer to them by name. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-config --rename-section could rename wrong sectionPavel Roskin2007-02-03
| | | | | | | | The "git-config --rename-section" implementation would match sections that are substrings of the section name to be renamed. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* combine-diff: special case --unified=0Junio C Hamano2007-02-03
| | | | | | | | | | Even when --unified=0 is given, the main loop to show the combined textual diff needs to handle a line that is unchanged but has lines that were deleted relative to a parent before it (because that is where the lost lines hang). However, such a line should not be emitted in the final output. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Why is it bad to rewind a branch that has already been pushed out?Junio C Hamano2007-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was reading the tutorial and noticed that we say this: Also, don't use "git reset" on a publicly-visible branch that other developers pull from, as git will be confused by history that disappears in this way. I do not think this is a good explanation. For example, if we do this: (1) I build a series and push it out. ---o---o---o---j (2) Alice clones from me, and builds two commits on top of it. ---o---o---o---j---a---a (3) I rewind one and build a few, and push them out. ---o---o---o...j \ h---h---h---h (4) Alice pulls from me again: ---o---o---o---j---a---a---* \ / h---h---h---h Contrary to the description, git will happily have Alice merge between the two branches, and never gets confused. Maybe I did not want to have 'j' because it was an incomplete solution to some problem, and Alice may have fixed it up with her changes, while I abandoned that approach I started with 'j', and worked on something completely unrelated in the four 'h' commits. In such a case, the merge Alice would make would be very sensible, and after she makes the merge if I pull from her, the world will be perfect. I started something with 'j' and dropped the ball, Alice picked it up and perfected it while I went on to work on something else with 'h'. This would be a perfect example of distributed parallel collaboration. There is nothing confused about it. The case the rewinding becomes problematic is if the work done in 'h' tries to solve the same problem as 'j' tried to solve in a different way. Then the merge forced on Alice would make her pick between my previous attempt with her fixups (j+a) and my second attempt (h). If 'a' commits were to fix up what 'j' started, presumably Alice already studied and knows enough about the problem so she should be able to make an informed decision to pick between what 'j+a' and 'h' do. A lot worse case is if Alice's work is not at all related to what 'j' wanted to do (she did not mean to pick up from where I left off -- she just wanted to work on something different). Then she would not be familiar enough with what 'j' and 'h' tried to achieve, and I'd be forcing her to pick between the two. Of course if she can make the right decision, then again that is a perfect example of distributed collaboration, but that does not change the fact that I'd be forcing her to clean up my mess. Signed-off-by: Junio C Hamano <junkio@cox.net>
* honor GIT_REFLOG_ACTION in git-commitJunio C Hamano2007-02-03
| | | | | | | | This allows git-cherry-pick and git-revert to properly identify themselves in the resulting reflog entries. Earlier they were recorded as what git-commit has done. Signed-off-by: Junio C Hamano <junkio@cox.net>
* fix reflog entries for "git-branch"Junio C Hamano2007-02-03
| | | | | | | | | | | | | | | Even when -l is not given from the command line, the repository may have the configuration variable core.logallrefupdates set, or an old-timer might have done ": >.git/logs/refs/heads/new" before running "git branch new". In these cases, the code gave an uninitialized msg[] from the stack to be written out as the reflog message. This also passes a different message when '-f' option is used. Saying "git branch -f branch some-commit" is a moral equilvalent of doing "git-reset some-commit" while on the branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
* core-tutorial: http reference link fixJunio C Hamano2007-02-02
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Tutorial-2: Adjust git-status output to recent reality.Junio C Hamano2007-02-02
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Tutorial: fix asciidoc formatting of "git add" section.Junio C Hamano2007-02-02
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Don't leak file descriptors from unavailable pack files.Shawn O. Pearce2007-02-02
| | | | | | | | | | | | If open_packed_git failed it may have been because the packfile actually exists and is readable, but some sort of verification did not pass. In this case open_packed_git left pack_fd filled in, as the file descriptor is valid. We don't want to leak the file descriptor, nor do we want to allow someone in the future to use this packed_git. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* doc: hooks.txt said post-commit default sends an email, it doesn'tAndy Parkins2007-02-02
| | | | | | | | The default post-commit hook is actually empty; it is the update hook that sends an email. This patch corrects hooks.txt to reflect that. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Disallow invalid --pretty= abbreviationsEric Wong2007-02-02
| | | | | | | | --pretty=o is a valid abbreviation, --pretty=omfg is not Noticed by: Nicolas Vilz Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix some documentation typos and grammarMike Coleman2007-02-01
| | | | | | | Also suggest user manual mention .gitignore. Signed-off-by: Michael Coleman <tutufan@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Don't find objects in packs which aren't available anymore.Shawn O. Pearce2007-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Matthias Lederhofer identified a race condition where a Git reader process was able to locate an object in a packed_git index, but was then preempted while a `git repack -a -d` ran and completed. By the time the reader was able to seek in the packfile to get the object data, the packfile no longer existed on disk. In this particular case the reader process did not attempt to open the packfile before it was deleted, so it did not already have the pack_fd field popuplated. With the packfile itself gone, there was no way for the reader to open it and fetch the data. I'm fixing the race condition by teaching find_pack_entry to ignore a packed_git whose packfile is not currently open and which cannot be opened. If none of the currently known packs can supply the object, we will return 0 and the caller will decide the object is not available. If this is the first attempt at finding an object, the caller will reprepare_packed_git and try again. If it was the second attempt, the caller will typically return NULL back, and an error message about a missing object will be reported. This patch does not address the situation of a reader which is being starved out by a tight sequence of `git repack -a -d` runs. In this particular case the reader will try twice, probably fail both times, and declare the object in question cannot be found. As it is highly unlikely that a real world `git repack -a -d` can complete faster than a reader can open a packfile, so I don't think this is a huge concern. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Refactor open_packed_git to return an error code.Shawn O. Pearce2007-02-01
| | | | | | | | | | | | | | Because I want to reuse open_packed_git in a context where I don't want the process to die if the packfile in question is bogus, I'm changing its behavior to return error("...") rather than die("...") when it detects something is wrong with the packfile it was given. Right now we still must die out of use_pack should open_packed_git fail, as none of use_pack's callers are prepared to handle a failure from that function. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Correct comment in prepare_packed_git_one.Shawn O. Pearce2007-02-01
| | | | | | | | | | After staring at the comment and the associated for loop, I realized the comment was completely bogus. The section of code its talking about is trying to avoid duplicate mapping of the same packfile. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Cleanup prepare_packed_git_one to reuse install_packed_git.Shawn O. Pearce2007-02-01
| | | | | | | | | There is little point in having the linked list insertion code appearing in install_packed_git, and then again just 30 lines further down in the same file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Teach 'git remote' how to cleanup stale tracking branches.Shawn O. Pearce2007-02-01
| | | | | | | | | | Since it can be annoying to manually cleanup 40 tracking branches which were removed by the remote system, 'git remote prune <n>' can now be used to delete any tracking branches under <n> which are no longer available on the remote system. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Pull out remote listing functions in git-remote.Shawn O. Pearce2007-02-01
| | | | | | | | | | I want to reuse the stale branch detection to implement a new 'git remote prune' subcommand. Easiest way to do that is to use the same logic that 'git remote show' uses to determine the stale tracking branches, then delete those. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: do not let Git.pm warn if we prematurely close pipesEric Wong2007-02-01
| | | | | | | This mainly quiets down warnings when running git svn log. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Update the documentation for the new '@{...}' syntaxJohannes Schindelin2007-02-01
| | | | | Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Teach the '@{...}' notation to git-log -gJohannes Schindelin2007-02-01
| | | | | Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* provide a nice @{...} syntax to always mean the current branch reflogNicolas Pitre2007-02-01
| | | | | | | | This is shorter than HEAD@{...} and being nameless it has no semantic issues. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* prevent HEAD reflog to be interpreted as current branch reflogNicolas Pitre2007-02-01
| | | | | | | | | | | The work in progress to enable separate reflog for HEAD will make it independent from reflog of any branch HEAD might be pointing to. In the mean time disallow HEAD@{...} until that work is completed. Otherwise people might get used to the current behavior which makes HEAD@{...} an alias for <current_branch>@{...} which won't be the case later. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Use "git checkout -q" in git-bisectJunio C Hamano2007-02-01
| | | | | | | | Converts one use of git-checkout in git-bisect not to say "switching to branch". It looks like all the other cases it is friendlier to give notice to the end user. Signed-off-by: Junio C Hamano <junkio@cox.net>
* add a quiet option to git-checkoutNicolas Pitre2007-02-01
| | | | | | | | Those new messages are certainly nice, but there might be cases where they are simply unwelcome, like when git-commit is used within scripts. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* reword the detached head message a little againNicolas Pitre2007-02-01
| | | | | | | Seems clearer this way, to me at least. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* detached HEAD -- finishing touchesJunio C Hamano2007-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates "git-checkout" to report which branch you are switching to. Especially for people who do not use __git_ps1 from contrib/completion/git-completion.bash this would give a friendlier feedback of what is going on, and should make the reminder message much less scary. Here is a sample session (the prompt tells which branch I am on). * I have some local modification and realize that the change deserves to be on its own new topic branch. [git.git (master)]$ git diff --stat git-checkout.sh | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) * So I switch to a new branch. I get a listing of local modifications and assuring "Switched to a new branch" message. [git.git (master)]$ git checkout -b jc/checkout M git-checkout.sh Switched to a new branch "jc/checkout" * If I switch back to "master", I get essentially the same. [git.git (jc/checkout)]$ git checkout master M git-checkout.sh Switched to branch "master" * Detaching head would say which commit I am at and reminds me that I am not on any branch (not that I would detach my HEAD while keeping precious local changes around in any real-world workflow -- this is just a sample session). [git.git (master)]$ git checkout master^ M git-checkout.sh Note: you are not on any branch and are at commit "master^" If you want to create a new branch from this checkout, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new_branch_name> * Coming back to an attached state can lose the detached HEAD, so I get warned and stopped. [git.git]$ git checkout master You are not on any branch and switching to branch 'master' may lose your changes. At this point, you can do one of two things: (1) Decide it is Ok and say 'git checkout -f master'; (2) Start a new branch from the current commit, by saying 'git checkout -b <branch-name>'. Leaving your HEAD detached; not switching to branch 'master'. * Moving around while my HEAD is detached is Ok. I still get the list of local modifications. [git.git]$ git checkout master^0 M git-checkout.sh * The previous step that switched to the tip commit is an obscure but useful trick. My HEAD is still detached but now it is pointed at by an existing ref, so I can come back safely. [git.git]$ git checkout master M git-checkout.sh Switched to branch "master" * And we are back on the "master" branch. [git.git (master)]$ exit Signed-off-by: Junio C Hamano <junkio@cox.net>
* GIT v1.5.0-rc3v1.5.0-rc3Junio C Hamano2007-01-31
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Do not use hardcoded path to xhmtl.xsl to generate user's manualJunio C Hamano2007-01-31
| | | | | | | | It does not seem to need it either and gives an error on FC5 I use at kernel.org to cut documentation tarballs, so remove it in the meantime. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git main documentation: point at the user's manual.Junio C Hamano2007-01-31
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'master' of git://linux-nfs.org/~bfields/gitJunio C Hamano2007-01-31
|\ | | | | | | | | | | | | | | This is in the hope of giving JBF's user-manual wider exposure. I am not very happy with trailing whitespaces in the new document, but let's not worry too much about the formatting issues for now, but concentrate more on the structure and the contents.
| * user-manual: todo'sJ. Bruce Fields2007-01-30
| | | | | | | | | | | | Update todo's. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: point to README for gitweb informationJ. Bruce Fields2007-01-30
| | | | | | | | | | | | | | I'd like complete gitweb setup instructions some day, but for now just refer to the gitweb README. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * Two small typofixes.Junio C Hamano2007-01-29
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * user-manual: SHA1 -> object nameJ. Bruce Fields2007-01-29
| | | | | | | | | | | | Prefer "object name" to SHA1, at least in higher level documentation. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: document git-show-branch exampleJ. Bruce Fields2007-01-29
| | | | | | | | | | | | | | Document Junio's show-branch trick for finding out which tags are descendents of a given comit. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: minor "TODO" updatesJ. Bruce Fields2007-01-29
| | | | | | | | | | | | | | | | I still really want a section on interoperability with CVS, subversion, etc., but I'm not getting around to it very fast, so just add this to the TODO section for now. And a few other minor todo updates. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: rewrap a few long linesJ. Bruce Fields2007-01-29
| | | | | | | | | | | | Rewrap some long lines. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: reflogs, other recoveryJ. Bruce Fields2007-01-29
| | | | | | | | | | | | | | | | Add a brief discussion of reflogs. Also recovery of dangling commits seems to fit in here, so move some of the discussion out of Linus's email to here. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: fix a header levelJ. Bruce Fields2007-01-29
| | | | | | | | | | | | Oops. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: typo fixJ. Bruce Fields2007-01-29
| | | | | | | | | | | | Oops Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: add references to git-config man pageJ. Bruce Fields2007-01-29
| | | | | | | | | | | | | | | | | | | | Direct editing of config files may be more natural for users than using the git-config commandline; but we should still reference the git-config man page when we describe such editing, so people know where to go for details on the config file syntax and meanings of the variables. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: repo-config -> configJ. Bruce Fields2007-01-28
| | | | | | | | | | | | | | Looks like we're going to allow git-config as the preferred alias to git-repo-config, so let's document that instead. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: fsck-objects -> fsckJ. Bruce Fields2007-01-28
| | | | | | | | | | | | There seems to be an agreement to rename fsck-objects to fsck. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: git-fsck, dangling objectsJ. Bruce Fields2007-01-28
| | | | | | | | | | | | | | Initial import of fsck and dangling objects discussion, mostly lifted from an email from Linus. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: reorganize fetch discussion, add internals, etc.J. Bruce Fields2007-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep git remote discussion in the first chapter, but postpone lower-level git fetch usage (to fetch individual branches) till later. Import a bunch of slightly modified text from the readme to give an architectural overview at the end. Add more discussion of history rewriting. And a bunch of other miscellaneous changes.... Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: stub discussion of fsck and reflogJ. Bruce Fields2007-01-26
| | | | | | | | | | | | | | Have some sort of recovery/reliability section that deals with reflog and fsck. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
| * user-manual: update git-gc discussionJ. Bruce Fields2007-01-21
| | | | | | | | | | | | | | It appears git-gc will no longer prune automatically, so we don't need to tell people not to do other stuff while running it. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>