summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-02-21git-apply: guess correct -p<n> value for non-git patches.Libravatar Junio C Hamano2-4/+111
This enhances the third point in the previous commit. When applying a non-git patch that begins like this: --- 2.6.orig/mm/slab.c +++ 2.6/mm/slab.c @@ -N,M +L,K @@@ ... and if you are in 'mm' subdirectory, we notice that -p2 is the right option to use to apply the patch in file slab.c in the current directory (i.e. mm/slab.c) The guess function also knows about this pattern, where you would need to use -p0 if applying from the top-level: --- mm/slab.c +++ mm/slab.c @@ -N,M +L,K @@@ ... Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-21git-apply: notice "diff --git" patch againLibravatar Junio C Hamano2-9/+18
Earlier one that tried to be too consistent with GNU patch by not stripping the leading path when we _know_ we are in a subdirectory and the patch is relative to the toplevel was a mistake. This fixes it. - No change to behaviour when it is run from the toplevel of the repository. - When run from a subdirectory to apply a git-generated patch, it uses the right -p<n> value automatically, with or without --index nor --cached option. - When run from a subdirectory to apply a randomly generated patch, it wants the right -p<n> value to be given by the user. The second one is a pure improvement to correct inconsistency between --index and non --index case, compared with 1.5.0. The third point could be further improved to guess what the right value for -p<n> should be by looking at the patch, but should be a topic of a separate patch. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-21Fix botched "leak fix"Libravatar Junio C Hamano1-2/+8
When (new_name == old_name), the previous one prefixed old_name alone, leaving new_name untouched, and worse yet, left it dangling pointing at an already freed memory location. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-21t4119: add test for traditional patch and different p_valueLibravatar Junio C Hamano1-2/+49
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-19apply: fix memory leak in prefix_one()Libravatar Johannes Schindelin1-6/+9
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-19git-apply: require -p<n> when working in a subdirectory.Libravatar Junio C Hamano2-28/+46
git-apply running inside a subdirectory, with or without --index, used to always assume that the patch is formatted in such a way to apply with -p1 from the toplevel, but it is more useful and consistent with the use of "GNU patch -p1" if it defaulted to assume that its input is meant to apply at the level it is invoked in. This changes the behaviour. It used to be that the patch generated this way would apply without any trick: edit Documentation/Makefile git diff >patch.file cd Documentation git apply ../patch.file You need to give an explicit -p2 to git-apply now. On the other hand, if you got a patch from somebody else who did not follow "patch is to apply from the top with -p1" convention, the input patch would start with: diff -u Makefile.old Makefile --- Makefile.old +++ Makefile and in such a case, you can apply it with: git apply -p0 patch.file Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-19git-apply: do not lose cwd when run from a subdirectory.Libravatar Junio C Hamano1-4/+4
When a patch modifies (not deletes) the last file in a directory, because we treat a modification just as deletion followed by creation, and deleting the last file in a directory automatically rmdir(2)'s that directory, we ended up removing the directory, which can potentially be the cwd, and then recreating the same directory to create the patch result. Avoid the rmdir step when remove_file() is called only because we are replacing it with the result by later calling create_file(). Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-18Teach 'git apply' to look at $HOME/.gitconfig even outside of a repositoryLibravatar Junio C Hamano1-5/+3
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-17Teach 'git apply' to look at $GIT_DIR/configLibravatar Junio C Hamano2-8/+103
When neither --index nor --cached was used, git-apply did not try calling setup_git_directory(), which means it did not look at configuration files at all. This fixes it to call the setup function but still allow the command to be run in a directory not controlled by git. The bug probably meant that 'git apply', not moving up to the toplevel, did not apply properly formatted diffs from the toplevel when you are inside a subdirectory, even though 'git apply --index' would. As a side effect, this patch fixes it as well. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-14GIT 1.5.0Libravatar Junio C Hamano1-1/+1
2007-02-13Add release notes to the distribution.Libravatar Junio C Hamano5-2/+490
This also adds a hook in the Makefile I can use to automatically include pointers to documentation for older releases when updating the pages at http://kernel.org/pub/software/scm/git/docs/. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-13Merge branch 'master' of git://repo.or.cz/git-guiLibravatar Junio C Hamano1-1/+1
* 'master' of git://repo.or.cz/git-gui: git-gui: fix typo in GIT-VERSION-GEN, "/dev/null" not "/devnull"
2007-02-13Documentation: Moving out of detached HEAD does not warn anymore.Libravatar Junio C Hamano1-16/+6
The documentation still talked about the unnecessary 'safety' in git-checkout. Pointed out by Matthias Lederhofer. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-13Mark places that need blob munging later for CRLF conversion.Libravatar Linus Torvalds3-0/+3
Here's a patch that I think we can merge right now. There may be other places that need this, but this at least points out the three places that read/write working tree files for git update-index, checkout and diff respectively. That should cover a lot of it [jc: git-apply uses an entirely different codepath both for reading and writing]. Some day we can actually implement it. In the meantime, this points out a place for people to start. We *can* even start with a really simple "we do CRLF conversion automatically, regardless of filename" kind of approach, that just look at the data (all three cases have the _full_ file data already in memory) and says "ok, this is text, so let's convert to/from DOS format directly". THAT somebody can write in ten minutes, and it would already make git much nicer on a DOS/Windows platform, I suspect. And it would be totally zero-cost if you just make it a config option (but please make it dynamic with the _default_ just being 0/1 depending on whether it's UNIX/Windows, just so that UNIX people can _test_ it easily). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-13Update RPM core package descriptionLibravatar Nicolas Pitre1-12/+9
Git isn't as stupid as it used to be Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-13Fix potential command line overflow in hooks--updateLibravatar Andy Parkins1-1/+1
In a repository with a large number of refs, the following command line could easily overflow the command line size limitations git-rev-list $newref $(git-rev-parse --not --all) Fortunately, git-rev-list already has the means to cope with this situation with the --stdin switch git-rev-parse --not --all | git-rev-list --stdin $newref Which is exactly what this patch does. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-13git-gc: run pack-refs by default unless the repo is bareLibravatar Johannes Schindelin3-0/+23
The config variable gc.packrefs is tristate now: "true", "false" and "notbare", where "notbare" is the default. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-13git-gui: fix typo in GIT-VERSION-GEN, "/dev/null" not "/devnull"Libravatar Andy Parkins1-1/+1
Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12"git-fetch --tags $URL" should not overwrite existing tagsLibravatar Junio C Hamano1-15/+2
Use the same --exclude-existing filter as we use for automatic tag following to avoid overwriting existing tags with replacement ones the other side created. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12for-each-reflog: not having $GIT_DIR/logs directory is not an error.Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Do not forget to pack objects reachable from HEAD reflog.Libravatar Junio C Hamano1-1/+1
Similar to commit eb8381c8, we need to use for_each_reflog() to make sure we do not miss objects reachable from HEAD reflog. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Work around Subversion race in git-svn tests.Libravatar Michael Spang5-2/+13
Some of the git-svn tests can fail on fast machines due to a race in Subversion: if a file is modified in the same second it was checked out (or in for that matter), Subversion will not consider it modified. This works around the problem by increasing the timestamp by one second before each commit. [jc: with "touch -r -d" replacement from Eric] Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Michael Spang <mspang@uwaterloo.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Clarify that git-update-server-info should be run for every git-pushLibravatar Pavel Roskin1-8/+8
The old text suggested that git-update-server-info only needs to be run if new tags or branches are created, but not for new commits. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12blameview: Move the commit info to a pane below the blame window.Libravatar Aneesh Kumar K.V1-7/+26
Also spawn the the new blameview in the background Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12git merge documentation: -m is optionalLibravatar Matthias Lederhofer1-1/+1
Changed -m=<msg> to -m <msg> too. Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Make gitk save and restore window pane position on Linux and Cygwin.Libravatar Mark Levedahl1-10/+13
Subtle bugs remained on both Cygwin and Linux that caused the various window panes to be restored in positions different than where the user last placed them. Sergey Vlasov posed a pair of suggested fixes to this, what is done here is slightly different. The basic fix here involves a) explicitly remembering and restoring the sash positions for the upper window, and b) using paneconfigure to redundantly set height and width of other elements. This redundancy is needed as Cygwin Tcl has a nasty habit of setting pane sizes to zero if their slaves are not configured with a specific size, but Linux Tcl does not honor the specific size given. Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Add RPM target for git-guiLibravatar Junio C Hamano1-3/+23
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Link git-gui into the master Makefile.Libravatar Shawn O. Pearce1-2/+8
I'm exporting gitexecdir because git-gui wants to know where it should install git-gui and git-citool. These belong under gitexecdir, just like git-diff, as the git wrapper is able to invoke these commands for the end-user. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Merge branch 'master' of git://repo.or.cz/git-guiLibravatar Junio C Hamano3-19/+58
* 'master' of git://repo.or.cz/git-gui: git-gui: Change base version to 0.6. git-gui: Guess our version accurately as a subproject. git-gui: Handle gitgui tags in version gen. git-gui: Generate a version file on demand. git-gui: Rename GIT_VERSION to GITGUI_VERSION. git-gui: Allow gitexecdir, INSTALL to be set by the caller.
2007-02-12git-gui: Change base version to 0.6.Libravatar Shawn O. Pearce1-1/+1
This is the start of the 0.6 series of git-gui. I'm calling it 0.6 (rather than any other value) as I already had a private tag on one system based on 0.5, and that tag is quite a bit behind this version. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12git-gui: Guess our version accurately as a subproject.Libravatar Shawn O. Pearce1-4/+37
When we are included as a subproject, such as how git.git carries us, we want to retain our own version number and not the version number assigned by git.git's own tags. Consequently we need to locate the correct tag which applies to our tree content and its commit lineage. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12git-gui: Handle gitgui tags in version gen.Libravatar Shawn O. Pearce1-5/+3
I've decided to use gitgui-0.5 as the format for tags in the git-gui repository. The prefix of gitgui was chosen here to make its namespace different from the namespace used by git itself, allowing developers to pull both tag namespaces into the same repository. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12git-gui: Generate a version file on demand.Libravatar Shawn O. Pearce1-1/+5
Because git-gui is being shipped as a subproject of the main Git project and will often have a different lifecycle than the main Git project, we should ship our own version number in the release tarball rather than relying on the main Git version file. Git's master Makefile will invoke our own with the target dist-version, asking us to save off our GITGUI_VERSION value into our own version file, so that our GIT-VERSION-GEN script can recover it at build time. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12git-gui: Rename GIT_VERSION to GITGUI_VERSION.Libravatar Shawn O. Pearce3-6/+6
Now that the decision has been made to treat git-gui as a subproject, rather than merging it directly into git, we should use a different substitution for our version value to avoid any possible confusion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12git-gui: Allow gitexecdir, INSTALL to be set by the caller.Libravatar Shawn O. Pearce1-3/+7
When used as a subproject within git.git our Makefile must honor the gitexecdir which git.git's Makefile is passing down to us, ensuring that we install our executables into the libexec chosen by the end-user or packager. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12import-tars: brown paper bag fix for file mode.Libravatar Michael Loeffler1-3/+1
There is a bug with this $git_mode variable which should be 0644 or 0755, but nothing else I think. Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12fast-import: Support reusing 'from' and brown paper bag fix reset.Libravatar Shawn O. Pearce3-14/+77
It was suggested on the mailing list that being able to use `from` in any commit to reset the current branch is useful in some types of importers, such as a darcs importer. We originally did not permit resetting an existing branch with a new `from` command during a `commit` command, but this restriction was only to help debug the hacked up cvs2svn that Jon Smirl was developing in parallel with git-fast-import. It is probably more of a problem to disallow it than to allow it. So now we permit a `from` during any `commit`. While making the changes required to permit multiple `from` commands on the same branch, I discovered we no longer needed the last_commit field to be set to 0 during a reset, so that was removed. (Reset was originally setting the field to 0 to signal cmd_from() that it was OK to execute on the branch.) While poking around in this section of fast-import I also realized the `reset` command was not working as intended if the corresponding `from` command was omitted (as allowed by the BNF grammar and the code). If `from` was omitted we cleared out the tree but we left the tree SHA-1 and parent commit SHA-1 intact. This is not what the user intended in this case. Instead they would be trying to reset the branch to have no parent and to have no tree, making the branch look new-born during the next commit. We now clear these SHA-1 values during `reset`, ensuring the branch looks new-born if `from` does not get supplied. New test cases for these were also added. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-11Merge git-guiLibravatar Junio C Hamano5-0/+6065
This merges git-gui project of Shawn as a subproject of git.git at git-gui/ subdirectory. This merge only melds two histories together. The toplevel Makefile does not even know about git-gui yet. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11Add discussion section to git-tag documentation.Libravatar Junio C Hamano1-0/+131
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11Teach git-am to pass -p option down to git-applyLibravatar Junio C Hamano2-8/+6
This is originally from Andy Parkins whose patch used --patchdepth; let's use -p which is more in line with the underlying git-apply. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11Documentation: git-rebase -C<n>Libravatar Junio C Hamano1-1/+1
Replace -CNUM in Synopsis section with -C<n> to make it consistent with the description text. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11Merge branch 'master' of git://repo.or.cz/git/fastimportLibravatar Junio C Hamano4-11/+67
* 'master' of git://repo.or.cz/git/fastimport: bash: Hide git-fast-import. fast-import: Add tip about importing renames. fast-import: Hide the pack boundary commits by default.
2007-02-11bash: Hide git-fast-import.Libravatar Shawn O. Pearce1-0/+1
The new git-fast-import command is not intended to be invoked directly by an end user. So offering it as a possible completion for a subcommand is not very useful. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-11fast-import: Add tip about importing renames.Libravatar Shawn O. Pearce1-0/+7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-11fast-import: Hide the pack boundary commits by default.Libravatar Shawn O. Pearce3-11/+59
Most users don't need the pack boundary information that fast-import was printing to standard output, especially if they were calling it with --quiet. Those users who do want this information probably want it captured so they can go back and use it to repack the imported repository. So dumping the boundary commits to a log file makes more sense then printing them to standard output. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-11git-gui: Stop deleting gitk preferences.Libravatar Shawn O. Pearce1-8/+0
Now that git 1.5.0 and later contains a version of gitk that uses correct geometry on Windows platforms, even if ~/.gitk exists, we should not delete the user's ~/.gitk to work around the bug. It is downright mean to remove a user's preferences for another app. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-11Document that git-am can read standard input.Libravatar Michael S. Tsirkin1-0/+4
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11Make gitk save and restore the user set window position.Libravatar Mark Levedahl1-5/+6
gitk was saving widget sizes and positions when the main window was destroyed, which is after all child widgets are destroyed. The cure is to trap the WM_DELETE_WINDOW event before the gui is torn down. Also, the saved geometry was captured using "winfo geometry .", rather than "wm geometry ." Under Linux, these two return different answers and the latter one is correct. [jc: credit goes to Brett Schwarz for suggesting the use of "wm protocol"; I also squashed the follow-up patch to remove extraneous -0 from expressions.] Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11t4016: test quoting funny pathnames in diff outputLibravatar Junio C Hamano1-0/+66
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11diff.c: More logical file name quoting for renames in diffstat.Libravatar Alexandre Julliard1-7/+27
Quote both file names separately when printing a rename, yielding something like "foo" => "bar" instead of the current "foo => bar" Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>