Linus Torvalds [Mon, 8 Oct 2007 20:42:41 +0000 (13:42 -0700)]
Fix embarrassing "git log --follow" bug
It turns out that I completely broke "git log --follow" with my recent
patch to revision.c ("Fix revision log diff setup, avoid unnecessary diff
generation", commit
b7bb760d5ed4881422673d32f869d140221d3564).
Why? Because --follow obviously requires the diff machinery to function,
exactly the same way pickaxe does.
So everybody is away right now, but considering that nobody even noticed
this bug, I don't think it matters. But for the record, here's the trivial
one-liner fix (well, two, since I also fixed the comment).
Because of the nature of the bug, if you ask for patches when following
(which is one of the things I normally do), the bug is hidden, because
then the request for diff output will automatically also enable the diffs
themselves.
So while "git log --follow <filename>" didn't work, adding a "-p"
magically made it work again even without this fix.
Signed-off-by: Linus Torvalds <redacted>
Signed-off-by: Lars Hjemli <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Sat, 13 Oct 2007 19:41:31 +0000 (15:41 -0400)]
git-gui: Honor a config.mak in git-gui's top level
I keep forgetting to include TCLTK_PATH when I build git-gui on some
systems. Placing that rule (among others) into a config.mak makes it
easier to compile the application the same way every time.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 20:33:45 +0000 (16:33 -0400)]
git-gui: Collapse $env(HOME) to ~/ in recent repositories on Windows
Apparently native Tcl/Tk on Windows is using \ as the return value
from [file separator] but [file normalize] on that same system is
using / rather than \ to represent a directory separator. I really
think that is nuts, but its what is happening.
So we can actually just hardcode our separator to / as all systems
we support (Windows, Mac OS X, UNIX) use /.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 20:24:20 +0000 (16:24 -0400)]
git-gui: Support cloning Cygwin based work-dirs
If the user tries to clone a Git repository that is actually a
workdir of another repository (by way of contrib git-new-workdir)
then the contents of .git is a series of Windows .lnk files which
Tcl can't read if this is a native Tcl process. To read the real
objects directory we need to resolve the link to that location.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 20:11:35 +0000 (16:11 -0400)]
git-gui: Use proper Windows shortcuts instead of bat files
On Windows its better to use a shortcut (.lnk file) over a batch
script (.bat) as we can specify the icon file for the .lnk and
thus have these git specific objects appear on the desktop with
that git specific icon file.
Unfortunately the authors of Tcl did not bless us with the APIs
needed to create shortcuts from within Tcl. But Microsoft did
give us Windows Scripting Host which allows us to execute some
JavaScript that calls some sort of COM object that can operate
on a .lnk file.
We now build both Cygwin and non-Cygwin "desktop icons" as proper
Windows .lnk files, using the "Start in" property of these files
to indicate the working directory of the repository the user wants
to launch.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 16:18:02 +0000 (12:18 -0400)]
git-gui: Ensure copyright message is correctly read as UTF-8
On Windows using the native Tcl/Tk the copyright header is
being read from the script using the system encoding, which
may not be utf-8. This causes the multi-byte copyright symbol
(which is actually encoded as utf-8) to read as two characters
and not as a proper copyright symbol. Explicitly asking Tcl
to read this sequence of bytes as utf-8 corrects the issue.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 15:13:58 +0000 (11:13 -0400)]
git-gui: Bind n/c/o accelerators in repository chooser
On Windows we need to actually setup binds for the accelerator
keys, otherwise the OS doesn't respond to them when the user
presses the key combinations. Apparently we automatically get
these on Mac OS X when we configure the menu commands, but not
on Windows.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 15:04:20 +0000 (11:04 -0400)]
git-gui: Disable the text widget in the repository chooser
Although we are using a text widget here we really do not
want the end-user to be able to modify the text it displays.
So we need to disable it.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 15:15:02 +0000 (11:15 -0400)]
git-gui: Fix bind errors when switching repository chooser panels
We need to remove any variable traces we may have installed
when the panel is destroyed as the trace may attempt to use
a widget that no longer exists on this panel.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 05:56:06 +0000 (01:56 -0400)]
git-gui: Offer repository management features in menu bar
When we show the repository chooser as the primary toplevel (".") we
now offer the major choices not just on the window as hyperlinks but
they also now are shown in the Repository menu, including the recent
repository list.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 05:34:36 +0000 (01:34 -0400)]
git-gui: Change repository browser radio buttons to hyperlinks
Making a user click twice to select which action they want to perform
when starting git-gui is just wasting their time. Clicking once on a
radio button and then clicking again on the "Next >" button is quite
unnecessary.
Since the recent repository list is shown as a list of hyperlinks we
now offer the 3 basic startup actions as hyperlinks. Clicking on a
link will immediately jump to the next UI panel, saving the user time
as they don't need to click an additional button.
Signed-off-by: Shawn O. Pearce <redacted>
Steffen Prohaska [Mon, 8 Oct 2007 06:25:47 +0000 (08:25 +0200)]
git-gui: offer a list of recent repositories on startup
If git-gui is started outside a work tree the repository chooser
will offer a list of recently opened repositories. Clicking on
any list entry directly opens the repository.
The list of recently opened repositories is stored in the config
as the multi-valued option gui.recentrepo. If the list grows beyond
10 entries it will be truncated by removing one of the older entries.
Only repositories that are opened through the repository chooser
will get added to the recent list. Repositories opened from the
shell will not yet be added to the recent list, as users are likely
to have a way to easily return to the same directory via their shell.
[sp: This is actually a combined work from both Steffen and myself.
Most of the ideas are Steffen's, as is the basic outline of
the code, but any outstanding bugs are entirely my fault.]
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 04:54:15 +0000 (00:54 -0400)]
git-gui: Support LFs embedded in config file values
Using the new --null option added to git-config in git 1.5.3 we
can safely accept LFs that are embedded in configuration options.
This does require a completely different configuration file parser
then the pre 1.5.3 version as we are splitting on very different
values.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 04:42:17 +0000 (00:42 -0400)]
git-gui: Refactor git-config --list parsing
The parsing for the output of `git config --list` is the same for
both the global options and the current repository's options so we
can really just use the same parser between them.
I'm currently just refactoring the parser so we can use a different
one depending on the version of git available to us at runtime. My
next change will add support for 1.5.3's --null option.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 12 Oct 2007 04:34:04 +0000 (00:34 -0400)]
git-gui: Move load_config procedure below git-version selection
To better handle configuration options that contain LFs in their
values we want to use the new -z option available in git-config
version 1.5.3 and later. To configure load_config based upon the
git version we need to move thos below the git-version computation.
No logic changes yet, just a minor reordering of the code.
Signed-off-by: Shawn O. Pearce <redacted>
Johannes Sixt [Thu, 11 Oct 2007 00:50:40 +0000 (20:50 -0400)]
git-gui: Change main window layout to support wider screens
The layout is changed to have the file lists at the left (Unstaged
Changes at the top, Staged Changes below it) and the diff window
at the right (with the commit area below it).
+----------+---------------------+
| Unstaged | Diff area |
| | |
| | |
| | |
+----------+ |
| Staged | |
| +---------------------+
| | Commit area |
| | |
+----------+---------------------+
The advantages are:
- The height of the file lists can be adjusted independently to
fit the files that they contain.
- The diff viewer is higher.
On wide screens it is ok that the main window is now generally
wider, too.
Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Michele Ballabio [Wed, 10 Oct 2007 13:04:16 +0000 (15:04 +0200)]
git-gui: update Italian translation
An Italian glossary was also added. Some changes:
* commit (verb): (creare una) nuova revisione
* commit (noun): revisione
* checkout: attivazione
* tracking branch: duplicato locale di ramo remoto
* repository: archivio
* some terms are used with more consistency
Signed-off-by: Michele Ballabio <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Wed, 10 Oct 2007 08:11:43 +0000 (04:11 -0400)]
git-gui: Updated po strings based on current sources
Steffen Prohaska [Wed, 10 Oct 2007 06:58:59 +0000 (08:58 +0200)]
git-gui: add mingw specific startup wrapper
The wrapper adds the directory it is installed in to PATH.
This is required for the git commands implemented in shell.
git-gui fails to launch them if PATH is not modified.
The wrapper script also accepts an optional command line
switch '--working-dir <dir>' and changes to <dir> before
launching the actual git-gui. This is required to implement
the "Git Gui Here" Explorer shell extension.
As a last step the original git-gui script is launched,
which is expected to be located in the same directory
under the name git-gui.tcl.
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Steffen Prohaska [Wed, 10 Oct 2007 06:58:58 +0000 (08:58 +0200)]
git-gui: set NO_MSGFMT to force using pure tcl replacement in msysgit
Shawn's git-gui Makefile supports the pure tcl replacement
for msgfmt if setting NO_MSGFMT. This patch sets the NO_MSGFMT
for msysgit.
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Steffen Prohaska [Sat, 6 Oct 2007 09:29:02 +0000 (11:29 +0200)]
git-gui: add directory git-gui is located in to PATH (on Windows)
This commit modifies PATH to include a good guess where git
could be found. The first location to search for executable is
the directory git-gui is installed in. This is a good guess for
a sane installation.
Even if git is not available in PATH, git-gui is now able
to find it. Hence git-gui can be passed to wish as an absolute
path without caring about the environment.
We must modify PATH to be able to spawn shell based git commands.
For builtins it would be sufficient to located them and execute
them with their absolute path. But for shell based git commmands
PATH needs to be modified.
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Wed, 10 Oct 2007 05:23:23 +0000 (01:23 -0400)]
Merge branch 'cs/de'
* cs/de:
git-gui: Update German translation, including latest glossary changes
git-gui: Incorporate glossary changes into existing German translation
git-gui: Update German glossary according to mailing list discussion
git-gui: Add more words to translation glossary
Christian Stimming [Mon, 8 Oct 2007 19:34:56 +0000 (21:34 +0200)]
git-gui: Update German translation, including latest glossary changes
Christian Stimming [Fri, 5 Oct 2007 20:01:39 +0000 (22:01 +0200)]
git-gui: Incorporate glossary changes into existing German translation
Christian Stimming [Fri, 5 Oct 2007 20:32:55 +0000 (22:32 +0200)]
git-gui: Update German glossary according to mailing list discussion
Christian Stimming [Fri, 5 Oct 2007 20:30:32 +0000 (22:30 +0200)]
git-gui: Add more words to translation glossary
Shawn O. Pearce [Fri, 5 Oct 2007 12:47:23 +0000 (08:47 -0400)]
git-gui: Shorten the staged/unstaged changes title bar text
The titles for the staged and unstaged areas were usually opening
up too narrow by default, causing the text to be clipped by Tcl as
it tried to center the text in the middle of the available area.
This meant that users who were new to git-gui did not get to see
the entire header and may be unclear about what the different lists
are.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Mon, 8 Oct 2007 05:39:08 +0000 (22:39 -0700)]
git-gui: Bind Cmd-, to Preferences on Mac OS X
A Mac OS X UI convention is to have Cmd-, be the accelerator key
for the preferences window, which by convention is located in the
apple menu under a separator below the about command. We also now
call this "Preferences..." as that is the conventional term used
in English.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Mon, 8 Oct 2007 05:23:54 +0000 (22:23 -0700)]
git-gui: Consolidate the Fetch and Push menus into a Remote menu
Sometimes the Fetch menu looks really odd, such as if you are in a
repository that has no remotes configured when you start git-gui.
Here we didn't have any items to add to the Fetch menu so it was a
tad confusing for the end-user to see an empty menu on the menu bar.
We now place all of the commands related to fetching and pushing of
changes into a single "Remote" menu. This way we have a better class
of bucket that we can drop additional remote related items into such
as doing a remote merge or editing the remote configuration specs.
The shortcuts to execute fetch/remote prune/push on existing remote
specifications are now actually submenus listing the remotes by name.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Mon, 8 Oct 2007 01:12:31 +0000 (18:12 -0700)]
git-gui: Use progress meter in the status bar during index updates
If we are updating the index to stage or unstage changes or reverting
files in the working directory we can use the progress handling parts
of our status bar to perform this display work, reducing the amount of
code duplication we have in the index handling module.
Unfortunately the status bar is still a strict approximation as it is
unable to know when git-update-index has processed the data we fed to
it. The progress bar is actually a progress of the pipe buffer filling
up in the OS, not of the actual work done. Still, it tells the user we
are working and that has some value.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Sat, 6 Oct 2007 00:15:10 +0000 (20:15 -0400)]
git-gui: Include our Git logo in the about dialog
Most applications tend to have some sort of pretty image in the
about dialog, because it spruces the screen up a little bit and
makes the user happy about reading the information shown there.
We already have a logo in the repository selection wizard so we
can easily reuse this in the about dialog.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 5 Oct 2007 12:38:35 +0000 (08:38 -0400)]
git-gui: Refactor about dialog code into its own module
The about dialog is getting somewhat long in size and will probably
only get more complex as I try to improve upon its display. As the
options dialog is even more complex than the about dialog we move
the about dialog into its own module to reduce the complexity of the
option dialog module.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Fri, 5 Oct 2007 12:35:41 +0000 (08:35 -0400)]
git-gui: Refactor Henrik Nyh's logo into its own procedure
By moving the logo into its own procedure we can use it in
multiple locations within the UI, but still load it only if
the logo is going to be used by the application.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Wed, 10 Oct 2007 05:09:41 +0000 (01:09 -0400)]
Merge branch 'maint'
* maint:
git-gui: accept versions containing text annotations, like 1.5.3.mingw.1
Steffen Prohaska [Sat, 6 Oct 2007 13:27:22 +0000 (15:27 +0200)]
git-gui: accept versions containing text annotations, like 1.5.3.mingw.1
This commit teaches git-gui to accept versions with annotations
that start with text and optionally end with a dot followed by
a number.
This is needed by the current versioning scheme of msysgit,
which uses versions like 1.5.3.mingw.1. However, the changes
is not limited to this use case. Any version of the form
<numeric version>.<anytext>.<number> would be parsed and only
the starting <numeric version> used for validation.
[sp: Minor edit to remove unnecessary group matching]
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
Paul Mackerras [Sat, 6 Oct 2007 10:22:00 +0000 (20:22 +1000)]
gitk: Get rid of the diffopts variable
The only thing that could be specified with diffopts was the number
of lines of context, but there is already a spinbox for that. So
this gets rid of it.
Signed-off-by: Paul Mackerras <redacted>
Paul Mackerras [Sat, 6 Oct 2007 10:17:59 +0000 (20:17 +1000)]
gitk: Fix bug where the last few commits would sometimes not be visible
We weren't calling showstuff for the last few commits under some
circumstances, causing the scrolling region not to be extended right
to the end of the graph. This fixes it.
Signed-off-by: Paul Mackerras <redacted>
Paul Mackerras [Sat, 6 Oct 2007 10:16:06 +0000 (20:16 +1000)]
gitk: Add a font chooser
This adds buttons to the edit preferences window to allow the user to
choose the main font, the text font (used for the diff display window)
and the UI font. Pressing those buttons pops up a font chooser window
that lets the user pick the font family, size, weight (bold/normal)
and slant (roman/italic).
Signed-off-by: Paul Mackerras <redacted>
Paul Mackerras [Sat, 6 Oct 2007 08:27:37 +0000 (18:27 +1000)]
gitk: Keep track of font attributes ourselves instead of using font actual
Unfortunately there seems to be a bug in Tk8.5 where font actual -size
sometimes gives the wrong answer (e.g. 12 for Bitstream Vera Sans 9),
even though the font is actually displayed at the right size. This
works around it by parsing and storing the family, size, weight and
slant of the mainfont, textfont and uifont explicitly.
Signed-off-by: Paul Mackerras <redacted>
Paul Mackerras [Thu, 4 Oct 2007 12:27:13 +0000 (22:27 +1000)]
gitk: Use named fonts instead of the font specification
This replaces the use of $mainfont, $textfont and $uifont with named
fonts called mainfont, textfont and uifont. We also have variants
called mainfontbold and textfontbold. This makes it much easier to
make sure font size changes are reflected everywhere they should be,
since configuring a named font automatically changes all the widgets
that are using that font.
Signed-off-by: Paul Mackerras <redacted>
Paul Mackerras [Thu, 4 Oct 2007 12:19:24 +0000 (22:19 +1000)]
gitk: Fix bug causing Tcl error when changing find match type
When changing the selector for Exact/IgnCase/Regexp, we were getting
a Tcl error. This fixes it.
It also adds a workaround for a bug in alpha versions of Tk8.5 where
wordprocessor-style tabs don't seem to work properly around column 1.
Signed-off-by: Paul Mackerras <redacted>
Junio C Hamano [Thu, 4 Oct 2007 08:35:01 +0000 (01:35 -0700)]
Update state documentation link for 1.5.3.4
Signed-off-by: Junio C Hamano <redacted>
Linus Torvalds [Wed, 3 Oct 2007 02:28:19 +0000 (19:28 -0700)]
optimize diffcore-delta by sorting hash entries.
Here's a test-patch. I don't guarantee anything, except that when I did
the timings I also did a "wc" on the result, and they matched..
Before:
[torvalds@woody linux]$ time git diff -l0 --stat -C v2.6.22.. | wc
7104 28574 438020
real 0m10.526s
user 0m10.401s
sys 0m0.136s
After:
[torvalds@woody linux]$ time ~/git/git diff -l0 --stat -C v2.6.22.. | wc
7104 28574 438020
real 0m8.876s
user 0m8.761s
sys 0m0.128s
but the diff is fairly simple, so if somebody will go over it and say
whether it's likely to be *correct* too, that 15% may well be worth it.
[ Side note, without rename detection, that diff takes just under three
seconds for me, so in that sense the improvement to the rename detection
itself is larger than the overall 15% - it brings the cost of just
rename detection from 7.5s to 5.9s, which would be on the order of just
over a 20% performance improvement. ]
Hmm. The patch depends on half-way subtle issues like the fact that the
hashtables are guaranteed to not be full => we're guaranteed to have zero
counts at the end => we don't need to do any steenking iterator count in
the loop. A few comments might in order.
Linus
Steven Walter [Fri, 28 Sep 2007 17:24:19 +0000 (13:24 -0400)]
Don't checkout the full tree if avoidable
In most cases of branching, the tree is copied unmodified from the trunk
to the branch. When that is done, we can simply start with the parent's
index and apply the changes on the branch as usual.
[ew: rewritten from Steven's original to use SVN::Client instead
of the command-line svn client.
Since SVN::Client connects separately, we'll share our
authentication providers array between our usages of
SVN::Client and SVN::Ra, too. Bypassing the high-level
SVN::Client library can avoid this, but the code will be
much more complex. Regardless, any implementation of this
seems to require restarting a connection to the remote
server.
Also of note is that SVN 1.4 and later allows a more
efficient diff_summary to be done instead of a full diff,
but since this code is only to support SVN < 1.4.4, we'll
ignore it for now.]
Signed-off-by: Steven Walter <redacted>
Signed-off-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Thu, 4 Oct 2007 00:42:52 +0000 (17:42 -0700)]
builtin-apply: fix conversion error in strbuf series
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 3 Oct 2007 11:28:24 +0000 (04:28 -0700)]
Merge branch 'mv/unknown'
* mv/unknown:
Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
Junio C Hamano [Wed, 3 Oct 2007 10:06:02 +0000 (03:06 -0700)]
Merge branch 'ph/strbuf'
* ph/strbuf: (44 commits)
Make read_patch_file work on a strbuf.
strbuf_read_file enhancement, and use it.
strbuf change: be sure ->buf is never ever NULL.
double free in builtin-update-index.c
Clean up stripspace a bit, use strbuf even more.
Add strbuf_read_file().
rerere: Fix use of an empty strbuf.buf
Small cache_tree_write refactor.
Make builtin-rerere use of strbuf nicer and more efficient.
Add strbuf_cmp.
strbuf_setlen(): do not barf on setting length of an empty buffer to 0
sq_quote_argv and add_to_string rework with strbuf's.
Full rework of quote_c_style and write_name_quoted.
Rework unquote_c_style to work on a strbuf.
strbuf API additions and enhancements.
nfv?asprintf are broken without va_copy, workaround them.
Fix the expansion pattern of the pseudo-static path buffer.
builtin-for-each-ref.c::copy_name() - do not overstep the buffer.
builtin-apply.c: fix a tiny leak introduced during xmemdupz() conversion.
Use xmemdupz() in many places.
...
Junio C Hamano [Wed, 3 Oct 2007 10:05:58 +0000 (03:05 -0700)]
Merge branch 'lh/merge'
* lh/merge:
git-merge: add --ff and --no-ff options
git-merge: add support for --commit and --no-squash
git-merge: add support for branch.<name>.mergeoptions
git-merge: refactor option parsing
git-merge: fix faulty SQUASH_MSG
Add test-script for git-merge porcelain
Junio C Hamano [Wed, 3 Oct 2007 10:05:39 +0000 (03:05 -0700)]
Merge branch 'js/rebase-i'
* js/rebase-i:
rebase -i: work on a detached HEAD
Junio C Hamano [Wed, 3 Oct 2007 10:05:32 +0000 (03:05 -0700)]
Merge branch 'jc/autogc'
* jc/autogc:
git-gc --auto: run "repack -A -d -l" as necessary.
git-gc --auto: restructure the way "repack" command line is built.
git-gc --auto: protect ourselves from accumulated cruft
git-gc --auto: add documentation.
git-gc --auto: move threshold check to need_to_gc() function.
repack -A -d: use --keep-unreachable when repacking
pack-objects --keep-unreachable
Export matches_pack_name() and fix its return value
Invoke "git gc --auto" from commit, merge, am and rebase.
Implement git gc --auto
Junio C Hamano [Wed, 3 Oct 2007 10:03:40 +0000 (03:03 -0700)]
Merge branch 'je/hooks'
* je/hooks:
post-checkout hook, tests, and docs
Junio C Hamano [Wed, 3 Oct 2007 10:03:22 +0000 (03:03 -0700)]
Merge branch 'ap/dateformat'
* ap/dateformat:
Add a test script for for-each-ref, including test of date formatting
dateformat: parse %(xxdate) %(yydate:format) correctly
Make for-each-ref's grab_date() support per-atom formatting
Make for-each-ref allow atom names like "<name>:<something>"
parse_date_format(): convert a format name to an enum date_mode
Junio C Hamano [Wed, 3 Oct 2007 10:03:15 +0000 (03:03 -0700)]
Sync with GIT 1.5.3.4
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 3 Oct 2007 09:33:11 +0000 (02:33 -0700)]
GIT 1.5.3.4
Signed-off-by: Junio C Hamano <redacted>
Andy Parkins [Tue, 2 Oct 2007 11:02:57 +0000 (12:02 +0100)]
Add a test script for for-each-ref, including test of date formatting
Signed-off-by: Andy Parkins <redacted>
Signed-off-by: Junio C Hamano <redacted>
Carl Worth [Wed, 3 Oct 2007 07:03:53 +0000 (00:03 -0700)]
Add test case for ls-files --with-tree
This tests basic functionality and also exercises a bug noticed
by Keith Packard, (prune_cache followed by add_index_entry can
trigger an attempt to realloc a pointer into the middle of an
allocated buffer).
Signed-off-by: Junio C Hamano <redacted>
Keith Packard [Wed, 3 Oct 2007 05:44:15 +0000 (22:44 -0700)]
Must not modify the_index.cache as it may be passed to realloc at some point.
The index cache is not static, growing as new entries are added. If
entries are added after prune_cache is called, cache will no longer
point at the base of the allocation, and realloc will not be happy.
I verified that this was the only place in the current source which
modified any index_state.cache elements aside from the alloc/realloc
calls in read-cache by changing the type of the element to 'struct
cache_entry ** const cache' and recompiling.
A more efficient patch would create a separate 'cache_base' value to
track the allocation and then fix things up when reallocation was
necessary, instead of the brute-force memmove used here.
Signed-off-by: Junio C Hamano <redacted>
Shawn O. Pearce [Tue, 2 Oct 2007 16:52:22 +0000 (12:52 -0400)]
git-gui: Allow forced push into remote repository
Some workflows allow the user to forcefully update a remote branch,
such as in a "proposed updates" (aka "pu") branch where the branch
is rewound and rebuilt on a daily basis against the current master
branch. In such a case the "--force" or leading + must be used to
make git-push execute anyway, even though it may be discarding one
or more commits on the remote side.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Wed, 3 Oct 2007 04:17:19 +0000 (00:17 -0400)]
Merge branch 'maint'
* maint:
git-gui: Don't crash when starting gitk from a browser session
git-gui: Allow gitk to be started on Cygwin with native Tcl/Tk
Conflicts:
git-gui.sh
Shawn O. Pearce [Tue, 2 Oct 2007 16:27:32 +0000 (12:27 -0400)]
git-gui: Don't crash when starting gitk from a browser session
If the user has started git-gui from the command line as a browser
we offer the gitk menu options but we didn't create the main status
bar widget in the "." toplevel. Trying to access it while starting
gitk just results in Tcl errors.
Signed-off-by: Shawn O. Pearce <redacted>
Shawn O. Pearce [Tue, 2 Oct 2007 16:24:44 +0000 (12:24 -0400)]
git-gui: Allow gitk to be started on Cygwin with native Tcl/Tk
gitk expects $env(GIT_DIR) to be valid as both a path that core Git
and Tcl/Tk can resolve to a valid directory, but it has no special
handling for Cygwin style UNIX paths and Windows style paths. So
we need to do that for gitk and ensure that only relative paths are
fed to it, thus allowing both Cygwin style and UNIX style paths to
be resolved.
Signed-off-by: Shawn O. Pearce <redacted>
Daniel Barkalow [Wed, 3 Oct 2007 02:49:15 +0000 (22:49 -0400)]
Restore default verbosity for http fetches.
This adds a verbosity level below 0 for suppressing default messages
with --quiet, and makes the default for http be verbose instead of
quiet. This matches the behavior of the shell script version of git-fetch.
Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
Robert Schiele [Wed, 3 Oct 2007 01:49:34 +0000 (03:49 +0200)]
the ar tool is called gar on some systems
Some systems that have only installed the GNU toolchain (prefixed with "g")
do not provide "ar" but only "gar". Make configure find this tool as well.
Signed-off-by: Robert Schiele <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 3 Oct 2007 04:01:03 +0000 (21:01 -0700)]
rename diff_free_filespec_data_large() to diff_free_filespec_blob()
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Tue, 25 Sep 2007 19:29:42 +0000 (15:29 -0400)]
diffcore-rename: cache file deltas
We find rename candidates by computing a fingerprint hash of
each file, and then comparing those fingerprints. There are
inherently O(n^2) comparisons, so it pays in CPU time to
hoist the (rather expensive) computation of the fingerprint
out of that loop (or to cache it once we have computed it once).
Previously, we didn't keep the filespec information around
because then we had the potential to consume a great deal of
memory. However, instead of keeping all of the filespec
data, we can instead just keep the fingerprint.
This patch implements and uses diff_free_filespec_data_large
to accomplish that goal. We also have to change
estimate_similarity not to needlessly repopulate the
filespec data when we already have the hash.
Practical tests showed 4.5x speedup for a 10% memory usage
increase.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Tue, 2 Oct 2007 23:42:29 +0000 (01:42 +0200)]
Mention 'cpio' dependency in INSTALL
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Federico Mena Quintero [Tue, 2 Oct 2007 23:36:30 +0000 (18:36 -0500)]
Make git-pull complain and give advice when there is nothing to merge with
Signed-off-by: Federico Mena Quintero <redacted>
Signed-off-by: Junio C Hamano <redacted>
Federico Mena Quintero [Tue, 2 Oct 2007 23:34:32 +0000 (18:34 -0500)]
Note that git-branch will not automatically checkout the new branch
Signed-off-by: Federico Mena Quintero <redacted>
Signed-off-by: Junio C Hamano <redacted>
Federico Mena Quintero [Tue, 2 Oct 2007 23:33:30 +0000 (18:33 -0500)]
Add documentation for --track and --no-track to the git-branch docs.
Signed-off-by: Federico Mena Quintero <redacted>
Signed-off-by: Junio C Hamano <redacted>
Federico Mena Quintero [Tue, 2 Oct 2007 23:32:32 +0000 (18:32 -0500)]
Say when --track is useful in the git-checkout docs.
The documentation used to say what the option does, but it
didn't mention a use case.
Signed-off-by: Federico Mena Quintero <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Tue, 2 Oct 2007 20:14:30 +0000 (21:14 +0100)]
Fix typo in config.txt
There was an 'l' (ell) instead of a '1' (one) in one of the gitlinks.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 2 Oct 2007 22:09:41 +0000 (15:09 -0700)]
for-each-ref: fix %(numparent) and %(parent)
The string value of %(numparent) was not returned correctly.
Also %(parent) misbehaved for the root commits (returned garbage)
and merge commits (returned first parent, followed by a space).
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 2 Oct 2007 21:31:37 +0000 (14:31 -0700)]
dateformat: parse %(xxdate) %(yydate:format) correctly
Andy Parkins noticed that parsing of the above would not
correctly notice that xxdate does not have any format
specifier.
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 2 Oct 2007 18:47:58 +0000 (11:47 -0700)]
git-commit: initialize TMP_INDEX just to be sure.
We rely on TMP_INDEX variable to decide if we are doing a partial commit,
as it is only set in the partial commit codepath. But the variable is
never initialized. A stray environment variable from outside could
ruin the day.
Signed-off-by: Junio C Hamano <redacted>
Steffen Prohaska [Tue, 2 Oct 2007 06:14:37 +0000 (08:14 +0200)]
fixed link in documentation of diff-options
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sun, 30 Sep 2007 23:59:39 +0000 (00:59 +0100)]
fetch/push: readd rsync support
We lost rsync support when transitioning from shell to C. Support it
again (even if the transport is technically deprecated, some people just
do not have any chance to use anything else).
Also, add a test to t5510. Since rsync transport is not configured by
default on most machines, and especially not such that you can write to
rsync://127.0.0.1$(pwd)/, it is disabled by default; you can enable it by
setting the environment variable TEST_RSYNC.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 1 Oct 2007 09:09:09 +0000 (02:09 -0700)]
Merge branch 'maint'
* maint:
Whip post 1.5.3.3 maintenance series into shape.
git stash: document apply's --index switch
post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used
Junio C Hamano [Mon, 1 Oct 2007 09:07:47 +0000 (02:07 -0700)]
Whip post 1.5.3.3 maintenance series into shape.
Signed-off-by: Junio C Hamano <redacted>
Miklos Vajna [Sun, 30 Sep 2007 22:30:27 +0000 (00:30 +0200)]
git stash: document apply's --index switch
Signed-off-by: Junio C Hamano <redacted>
Andy Parkins [Fri, 28 Sep 2007 14:24:26 +0000 (15:24 +0100)]
post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used
Using the name of the committer of the revision at the tip of the
updated ref is not sensible. That information is available in the email
itself should it be wanted, and by supplying a "From", we were
effectively hiding the person who performed the push - which is useful
information in itself.
Signed-off-by: Andy Parkins <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 1 Oct 2007 07:27:51 +0000 (00:27 -0700)]
git-am: fix typo in the previous one.
Caught on #git by Ulrik Sverdrup
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 1 Oct 2007 00:32:25 +0000 (17:32 -0700)]
Update stale documentation link in the k.org site
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Fri, 28 Sep 2007 15:28:54 +0000 (16:28 +0100)]
Introduce remove_dir_recursively()
There was a function called remove_empty_dir_recursive() buried
in refs.c. Expose a slightly enhanced version in dir.h: it can now
optionally remove a non-empty directory.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 28 Sep 2007 08:46:13 +0000 (01:46 -0700)]
bundle transport: fix an alloc_ref() call
Currently alloc_ref() expects the length of the refname plus 1
as its parameter, prepares that much space and returns a "ref"
structure for the caller to fill the refname. One caller in
transport.c::get_refs_from_bundle() however allocated one byte
less.
It may be a good idea to change the calling convention to give
alloc_ref() the length of the refname, but that clean-up can be
done in a separate patch. This patch only fixes the bug and
makes all callers consistent.
There was also one overallocation in connect.c, which would not
hurt but was wasteful. This patch fixes it as well.
Signed-off-by: Junio C Hamano <redacted>
Alexandre Julliard [Sat, 29 Sep 2007 09:59:32 +0000 (11:59 +0200)]
git.el: Reset the permission flags when changing a file state.
Signed-off-by: Alexandre Julliard <redacted>
Signed-off-by: Junio C Hamano <redacted>
Alexandre Julliard [Sat, 29 Sep 2007 09:59:07 +0000 (11:59 +0200)]
git.el: Update a file status in the git buffer upon save.
Signed-off-by: Alexandre Julliard <redacted>
Signed-off-by: Junio C Hamano <redacted>
Alexandre Julliard [Sat, 29 Sep 2007 09:58:39 +0000 (11:58 +0200)]
git.el: Do not print a status message on every git command.
Instead print a single message around sequences of commands that can
potentially take some time.
Signed-off-by: Alexandre Julliard <redacted>
Signed-off-by: Junio C Hamano <redacted>
Alexandre Julliard [Sat, 29 Sep 2007 09:58:08 +0000 (11:58 +0200)]
git.el: Preserve file marks when doing a full refresh.
Signed-off-by: Alexandre Julliard <redacted>
Signed-off-by: Junio C Hamano <redacted>
Daniel Barkalow [Sat, 29 Sep 2007 23:39:54 +0000 (19:39 -0400)]
Fix adding a submodule with a remote url
Without this, a non-path URL gets lost before the clone.
Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jari Aalto [Sun, 30 Sep 2007 06:34:19 +0000 (23:34 -0700)]
git-remote: exit with non-zero status after detecting error in "rm".
Exit with non-zero status when "git remote rm" was told to
remove a non-existing remote.
Signed-off-by: Jari Aalto <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sun, 30 Sep 2007 06:32:36 +0000 (23:32 -0700)]
Merge branch 'maint'
* maint:
git-remote: exit with non-zero status after detecting errors.
rebase -i: squash should retain the authorship of the _first_ commit
git-add--interactive: Improve behavior on bogus input
git-add--interactive: Allow Ctrl-D to exit
Jari Aalto [Sun, 30 Sep 2007 06:29:43 +0000 (23:29 -0700)]
git-remote: exit with non-zero status after detecting errors.
Some subcommands of "git-remote" detected and issued error
messages but did not signal that to the calling process with
exit status.
Signed-off-by: Jari Aalto <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sat, 29 Sep 2007 23:34:23 +0000 (00:34 +0100)]
rebase -i: squash should retain the authorship of the _first_ commit
It was determined on the mailing list, that it makes more sense for a
"squash" to keep the author of the first commit as the author for the
result of the squash.
Make it so.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sat, 29 Sep 2007 02:32:11 +0000 (03:32 +0100)]
rebase -i: support single-letter abbreviations for the actions
When you do many rebases, you can get annoyed by having to type out
the actions "edit" or "squash" in total.
This commit helps that, by allowing you to enter "e" instead of "edit",
"p" instead of "pick", or "s" instead of "squash".
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jean-Luc Herren [Wed, 26 Sep 2007 14:05:01 +0000 (16:05 +0200)]
git-add--interactive: Improve behavior on bogus input
1) Previously, any menu would cause a perl error when entered '0',
which is never a valid option.
2) Entering a bogus choice (like 998 or 4-2) surprisingly caused
the same behavior as if the user had just hit 'enter', which
means to carry out the selected action on the selected items.
Entering such bogus input is now a no-op and the sub-menu
doesn't exit.
Signed-off-by: Jean-Luc Herren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jean-Luc Herren [Wed, 26 Sep 2007 13:56:19 +0000 (15:56 +0200)]
git-add--interactive: Allow Ctrl-D to exit
Hitting Ctrl-D (EOF) is a common way to exit shell-like tools.
When in a sub-menu it will still behave as if an empty line had
been entered, carrying out the action on the selected items and
returning to the previous menu.
Signed-off-by: Jean-Luc Herren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Daniel Barkalow [Fri, 28 Sep 2007 23:34:17 +0000 (19:34 -0400)]
Allow abbreviations in the first refspec to be merged
The config item for a refspec side and the ref name that it matches
aren't necessarily character-for-character identical. We actually want
to merge a ref by default if: there is no per-branch config, it is the
found result of looking for the match for the first refspec, and the
first refspec is not a pattern. Beyond that, anything that
get_fetch_map() thinks matches is fine.
Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pierre Habouzit [Thu, 27 Sep 2007 11:33:19 +0000 (13:33 +0200)]
Make read_patch_file work on a strbuf.
So that we don't need to use strbuf_detach.
Signed-off-by: Pierre Habouzit <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pierre Habouzit [Thu, 27 Sep 2007 13:25:55 +0000 (15:25 +0200)]
strbuf_read_file enhancement, and use it.
* make strbuf_read_file take a size hint (works like strbuf_read)
* use it in a couple of places.
Signed-off-by: Pierre Habouzit <redacted>
Signed-off-by: Junio C Hamano <redacted>
Josh England [Wed, 26 Sep 2007 21:31:01 +0000 (15:31 -0600)]
post-checkout hook, tests, and docs
Updated post-checkout hook to take a flag specifying whether the checkout is
a branch checkout or a file checkout (from the index).
Signed-off-by: Josh England <redacted>
Signed-off-by: Junio C Hamano <redacted>