Commit Graph

21167 Commits

Author SHA1 Message Date
Giuseppe Bilotta
3748b03d92 git-gui: update shortcut tools to use _gitworktree
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:15:55 -08:00
Giuseppe Bilotta
29e5573d1e git-gui: handle bare repos correctly
Refactor checking for a bare repository into its own proc, that relies
on git rev-parse --is-bare-repository if possible. For older versions of
git we fall back to a logic such that the repository is considered bare
if:
 * either the core.bare setting is true
 * or the worktree is not set and the directory name ends with .git
The error message for the case of an unhandled bare repository is also
updated to reflect the fact that the problem is not the funny name but
the bareness.

The new refactored proc is also used to disable the menu entry to
explore the working copy, and to skip changing to the worktree before
the gitk invocation.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:21 -08:00
Giuseppe Bilotta
21985a1136 git-gui: handle non-standard worktree locations
Don't rely on the git worktree being the updir of the gitdir, since it
might not be. Instead, define (and use) a new _gitworktree global
variable, setting it to $GIT_WORK_TREE if present, falling back to
core.worktree if defined, and finally to whatever we guess the correct
worktree is. Getting core.worktree requires the config from the alleged
git dir _gitdir to be loaded early.

Supporting non-standard worktree locations also breaks the git-gui
assumption (made when calling gitk) that the worktree was the dirname of
$_gitdir and that, by consequence, the git dir could be set to the tail
of $_gitdir once we changed to the worktree root directory. Therefore,
we need to export a GIT_DIR environment variable set to the full,
normalized path of $_gitdir instead. We also skip changing to the worktree
directory if it's empty (i.e. if we're working on a bare repository).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:21 -08:00
Jeff Epler
ff07c3b621 git-gui: Support applying a range of changes at once
Multiple lines can be selected in the diff viewer and applied all
at once, rather than selecting "Stage Line For Commit" on each
individual line.

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:15 -08:00
Jens Lehmann
25476c63e7 git-gui: Add a special diff popup menu for submodules
To make it easier for users to deal with submodules, a special diff
popup menu has been added for submodules. The "Show Less Context"
and "Show More Context" entries have been removed, as they don't make
any sense for a submodule summary. Four new entries are added to the
top of the popup menu to gain access to more detailed information
about the changes in a submodule than the plain summary does offer.

These are:
- "Visualize These Changes In The Submodule"
  starts gitk showing the selected commit range

- "Visualize These Changes In The Submodule"
  starts gitk showing the whole submodule history of the current branch

- "Visualize All Branch History In The Submodule"
  starts gitk --all in the submodule

- "Start git gui In The Submodule"
  guess what :-)

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:15 -08:00
Jens Lehmann
a9ae14a1c5 git-gui: Use git diff --submodule when available
Doing so is much faster and gives the same output.
Here are some numbers:

  $ time git submodule summary
  real	0m0.219s
  user	0m0.050s
  sys	0m0.111s

  $ time git diff --submodule
  real	0m0.012s
  user	0m0.003s
  sys	0m0.009s

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:15 -08:00
Giuseppe Bilotta
87cd09f43e git-gui: work from the .git dir
When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.

Fix by expanding the value of _gitdir to pwd in this special case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:04 -08:00
Jeff Epler
390425bdef git-gui: Fix applying a line when all following lines are deletions
If a diff looked like:

 @@
  context
 -del1
 -del2

and you wanted to stage the deletion 'del1', the generated patch
wouldn't apply because it was missing the line 'del2' converted to
context, but this line was counted in the @@-line

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:00:09 -08:00
Jens Lehmann
7ec2b69f1a git-gui: Correct file_states when unstaging partly staged entry
When unstaging a partly staged file or submodule, the file_states
list was not updated properly (unless unstaged linewise). Its
index_info part did not contain the former head_info as it should
have but kept its old value.

This seems not to have had any bad effects but diminishes the value
of the file_states list for future enhancements.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:13 -08:00
Peter Krefting
e27d106ec4 git-gui: Fix gitk for branch whose name matches local file
When trying to run gitk on a branch name whose name matches a local
file, it will toss an error saying that the name is ambiguous. Adding
a pair of dashes will make gitk parse the options to the left of
it as branch names. Since wish eats the first pair of dashes we
throw at it, we need to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:12 -08:00
Christopher Beelby
3c6a287027 git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
When the number of recent repo's gets to ten there can be a
situation where an item is removed from the .gitconfig file via
a call to git config --unset, but the internal representation of
that file (repo_config(gui.recentrepo)) is not updated.  Then a
subsequent attempt to remove an item from the list fails because
git-gui attempts to call --unset on a value that has already
been removed.  This leads to duplicates in the .gitconfig file,
which then also cause errors if the git-gui tries to --unset them
(rather than using --unset-all. --unset-all is not used because it
is not expected that duplicates should ever be allowed to exist.)

When loading the list of recent repositories (proc _get_recentrepos)
if a repo in the list is not considered a valid git reposoitory
then we should go ahead and remove it so it doesn't take up a slot
in the list (since we limit to 10 items). This will prevent a bunch
of invalid entries in the list (which are not shown) from making
valid entries dissapear off the list even when there are less than
ten valid entries.

See: http://code.google.com/p/msysgit/issues/detail?id=362
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:12 -08:00
Pat Thoyts
ea888f84bd git-gui: handle really long error messages in updateindex.
As reported to msysGit (bug #340) it is possible to get some very
long error messages when updating the index. The use of a label to
display this prevents scrolling the output. This patch replaces the
label with a scrollable text widget configured to look like a label.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:22:28 -08:00
Christian Couder
dd8a8d476b Documentation: rev-list: fix synopsys for --tags and and --remotes
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-23 11:26:46 -08:00
Junio C Hamano
2bd6dbbe0b Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: allow subset of branches/tags to be specified in glob spec
  git-svn: allow UUID to be manually remapped via rewriteUUID
  git-svn: update svn mergeinfo test suite
  git-svn: document --username/commit-url for branch/tag
  git-svn: add --username/commit-url options for branch/tag
  git-svn: respect commiturl option for branch/tag
  git-svn: fix mismatched src/dst errors for branch/tag
  git-svn: handle merge-base failures
  git-svn: ignore changeless commits when checking for a cherry-pick
2010-01-23 10:42:47 -08:00
Jay Soffian
075762085c git-svn: allow subset of branches/tags to be specified in glob spec
For very large projects it is useful to be able to clone a subset of the
upstream SVN repo's branches. Allow for this by letting the left-side of
the branches and tags glob specs contain a brace-delineated comma-separated
list of names. e.g.:

	branches = branches/{red,green}/src:refs/remotes/branches/*

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:04 -08:00
Jay Soffian
3e18ce1ac3 git-svn: allow UUID to be manually remapped via rewriteUUID
In certain situations it may be necessary to manually remap an svn
repostitory UUID. For example:

                  o--- [git-svn clone]
                 /
[origin svn repo]
                 \
                  o--- [svnsync clone]

Imagine that only "git-svn clone" and "svnsync clone" are made available
to external users. Furthur, "git-svn clone" contains only trunk, and for
reasons unknown, "svnsync clone" is missing the revision properties that
normally provide the origin svn repo's UUID.

A git user who has cloned the "git-svn clone" repo now wishes to use
git-svn to pull in the missing branches from the "synsync clone" repo.
In order for git-svn to get the history correct for those branches,
it needs to know the origin svn repo's UUID. Hence rewriteUUID.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:04 -08:00
Andrew Myrick
c79f1189bc git-svn: update svn mergeinfo test suite
Add a partial branch (e.g., a branch from a project subdirectory) to the
git-svn mergeinfo test repository.

Add a tag and a branch from that tag to the git-svn mergeinfo test repository.

Update the test script to expect a known failure in git-svn exposed by these
additions where merge info for partial branches is not preserved.

Signed-off-by: Andrew Myrick <amyrick@apple.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:04 -08:00
Igor Mironov
a65f3c202b git-svn: document --username/commit-url for branch/tag
[ew: shortened subject]

Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:04 -08:00
Igor Mironov
6594f0b793 git-svn: add --username/commit-url options for branch/tag
Add ability to specify on the command line the username to perform the
operation as and the writable URL of the repository to perform it on.

[ew: shortened subject]

Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:04 -08:00
Igor Mironov
99bacd6c25 git-svn: respect commiturl option for branch/tag
When constructing a destination URL, use the property 'commiturl' if it
is specified in the configuration file; otherwise take 'url' as usual.
This accommodates the scenario where a user only wants to involve the
writable repository in operations performing a commit and defaults
everything else to a read-only URL.

[ew: shortened subject]

Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:03 -08:00
Igor Mironov
a83b91e724 git-svn: fix mismatched src/dst errors for branch/tag
This fixes the following issue:

$ git svn branch -t --username=svnuser \
  --commit-url=https://myproj.domain.com/svn mytag
Copying http://myproj.domain.com/svn/trunk at r26 to
https://myproj.domain.com/svn/tags/mytag...

Trying to use an unsupported feature: Source and dest appear not to be
in the same repository (src: 'http://myproj.domain.com/svn/trunk';
dst: 'https://myproj.domain.com/svn/tags/mytag')

[ew: shortened subject]

Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:03 -08:00
Andrew Myrick
41c01693ac git-svn: handle merge-base failures
Change git-svn to warn and continue when merge-base fails while processing svn
merge tickets.

merge-base can fail when a partial branch is created and merged back to trunk
in svn, because it cannot find a common ancestor between the partial branch and
trunk.

Signed-off-by: Andrew Myrick <amyrick@apple.com>
Acked-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:03 -08:00
Andrew Myrick
1cef6500a9 git-svn: ignore changeless commits when checking for a cherry-pick
Update git-svn to ignore commits that do not change the tree when it is
deciding if an svn merge ticket represents a real branch merge or just a
cherry-pick.

Consider the following integration model in the svn repository:

   F---G  branch1
  /     \
 D  tag1 \   E  tag2
/         \ /
A---B      C  trunk

branch1 is merged to trunk in commit C.

With this patch, git-svn will correctly identify branch1 as a proper merge
parent, instead of incorrectly ignoring it as a cherry-pick.

Signed-off-by: Andrew Myrick <amyrick@apple.com>
Acked-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-01-23 03:23:03 -08:00
David Aguilar
a88183f168 t7800-difftool.sh: Test mergetool.prompt fallback
4cacc621 made difftool fall back to mergetool.prompt
when difftool.prompt is unconfigured.  This adds a test.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 22:07:29 -08:00
Ramsay Jones
aba7dea83b msvc: Add a definition of NORETURN compatible with msvc compiler
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 16:35:42 -08:00
Junio C Hamano
c2c2be137a Update draft release notes to 1.7.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 16:34:50 -08:00
Ramsay Jones
3521c1bf5b msvc: Fix a compiler warning due to an incorrect pointer cast
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 16:15:16 -08:00
Ramsay Jones
38743b7d10 msvc: Fix an "unrecognized option" linker warning
Having recently added support for building git-imap-send on
Windows, we now link against OpenSSL libraries, and the linker
issues the following warning:

    warning LNK4044: unrecognized option '/lssl'; ignored

In order to suppress the warning, we change the msvc linker
script to translate an '-lssl' parameter to the ssleay32.lib
library.

Note that the linker script was already including ssleay32.lib
(along with libeay32.lib) as part of the translation of the
'-lcrypto' library parameter.  However, libeay32.dll does not
depend on ssleay32.dll and can be used stand-alone, so we remove
ssleay32.lib from the '-lcrypto' translation.

The dependence of ssleay32.dll on libeay32.dll is represented in
the Makefile by the NEEDS_CRYPTO_WITH_SSL build variable.

Also, add the corresponding change to the buildsystem generator.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 16:15:14 -08:00
Junio C Hamano
459a18864f Merge branch 'maint'
* maint:
  ignore duplicated slashes in make_relative_path()
2010-01-22 16:12:41 -08:00
Junio C Hamano
630724ca79 Merge branch 'jc/branch-d'
* jc/branch-d:
  branch -d: base the "already-merged" safety on the branch it merges with
2010-01-22 16:08:19 -08:00
Junio C Hamano
78bc024ab0 Merge branch 'il/rev-glob'
* il/rev-glob:
  Documentation: improve description of --glob=pattern and friends
  rev-parse --branches/--tags/--remotes=pattern
  rev-parse --glob
2010-01-22 16:08:16 -08:00
Junio C Hamano
4ca1b62386 Merge branch 'js/refer-upstream'
* js/refer-upstream:
  Teach @{upstream} syntax to strbuf_branchanme()
  t1506: more test for @{upstream} syntax
  Introduce <branch>@{upstream} notation
2010-01-22 16:08:13 -08:00
Junio C Hamano
c6ec7efdd4 Merge branch 'jl/submodule-diff'
* jl/submodule-diff:
  Performance optimization for detection of modified submodules
  git status: Show uncommitted submodule changes too when enabled
  Teach diff that modified submodule directory is dirty
  Show submodules as modified when they contain a dirty work tree
2010-01-22 16:08:10 -08:00
Junio C Hamano
16735ae0f8 Merge branch 'il/remote-updates'
* il/remote-updates:
  Add git remote set-url
2010-01-22 16:08:07 -08:00
Junio C Hamano
1a545d0b5f Merge branch 'il/branch-set-upstream'
* il/branch-set-upstream:
  branch: warn and refuse to set a branch as a tracking branch of itself.
  Add branch --set-upstream
2010-01-22 16:08:05 -08:00
Junio C Hamano
67bc740721 Merge branch 'jc/maint-limit-note-output'
* jc/maint-limit-note-output:
  Fix "log --oneline" not to show notes
  Fix "log" family not to be too agressive about showing notes
2010-01-22 16:08:01 -08:00
Junio C Hamano
f986eecde1 Merge branch 'nd/ls-files-sparse-fix'
* nd/ls-files-sparse-fix:
  Fix memory corruption when .gitignore does not end by \n
2010-01-22 16:07:18 -08:00
Sebastian Schuberth
4cacc621f8 Make difftool.prompt fall back to mergetool.prompt
The documentation states that "git-difftool falls back to git-mergetool
config variables when the difftool equivalents have not been defined".
Until now, this was not the case for "difftool.prompt".

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 15:57:45 -08:00
Ramsay Jones
74cf9bdda6 engine.pl: Fix a recent breakage of the buildsystem generator
Commit ade2ca0c (Do not try to remove directories when removing
old links, 2009-10-27) added an expression to a 'test' using an
'-o' or connective. This resulted in the buildsystem generator
mistaking a conditional 'rm' for a linker command. In order to
fix the breakage, we filter out all 'test' commands before then
attempting to identify the commands of interest.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 15:55:49 -08:00
Junio C Hamano
288123f01c ignore duplicated slashes in make_relative_path()
The function takes two paths, an early part of abs is supposed to match
base; otherwise abs is not a path under base and the function returns the
full path of abs.  The caller can easily confuse the implementation by
giving duplicated and needless slashes in these path arguments.

Credit for test script, motivation and initial patch goes to Thomas Rast.
A follow-up fix (squashed) is by Hannes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 15:34:56 -08:00
Junio C Hamano
af82559b43 git-mv: fix moving more than one source to a single destination
The code used as if return value from basename(3) were stable, but
often the function is implemented to return a pointer to a static
storage internal to it.

Because basename(3) is also allowed to modify its input parameter in
place, casting constness away from the strings we obtained from the
caller and giving them to basename is a no-no.

Reported, and initial fix and test supplied by David Rydh.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 14:31:30 -08:00
Michael Haggerty
30c9e919b6 rebase -i: Enclose sed command substitution in quotes
Reported by: Johannes Sixt <j.sixt@viscovery.net>

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 13:18:38 -08:00
Michael Haggerty
8cddaeec0d rebase -i: Avoid non-portable "test X -a Y"
Reported by: Eric Blake <ebb9@byu.net>

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 13:18:14 -08:00
Linus Torvalds
3bb7256281 make "index-pack" a built-in
This required some fairly trivial packfile function 'const' cleanup,
since the builtin commands get a const char *argv[] array.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 10:10:27 -08:00
Linus Torvalds
377d0276ca make "git pack-redundant" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 10:07:14 -08:00
Linus Torvalds
b53258182b make "git unpack-file" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 10:02:16 -08:00
Linus Torvalds
112dd51465 make "mktag" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 10:01:33 -08:00
Linus Torvalds
0ecace728f make "merge-index" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 10:01:21 -08:00
Johannes Sixt
07c0732067 merge-tree: remove unnecessary call of git_extract_argv0_path
This call should have been removed when the utility was made a builtin by
907a7cb.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 10:01:06 -08:00
Linus Torvalds
dedc0ec5d7 make "git patch-id" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21 22:06:12 -08:00