1
0
mirror of https://github.com/git/git.git synced 2024-10-05 03:21:35 +02:00
Commit Graph

11768 Commits

Author SHA1 Message Date
Nicolas Pitre
81f6654a47 Show total transferred as part of throughput progress
Right now it is infeasible to offer to the user a reasonable concept
of when a clone will be complete as we aren't able to come up with
the final pack size until after we have actually transferred the
entire thing to the client.  However in many cases users can work
with a rough rule-of-thumb; for example it is somewhat well known
that git.git is about 16 MiB today and that linux-2.6.git is over
120 MiB.

We now show the total amount of data we have transferred over
the network as part of the throughput meter, organizing it in
"human friendly" terms like `ls -h` would do.  Users can glance at
this, see that the total transferred size is about 3 MiB, see the
throughput of X KiB/sec, and determine a reasonable figure of about
when the clone will be complete, assuming they know the rough size
of the source repository or are able to obtain it.

This is also a helpful indicator that there is progress being made
even if we stall on a very large object.  The thoughput meter may
remain relatively constant and the percentage complete and object
count won't be changing, but the total transferred will be increasing
as additional data is received for this object.

[from an initial proposal from Shawn O. Pearce]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-01 15:22:32 -07:00
Nicolas Pitre
3e935d1982 make sure throughput display gets updated even if progress doesn't move
Currently the progress/throughput display update happens only through
display_progress().  If the progress based on object count remains
unchanged because a large object is being received, the latest throughput
won't be displayed.  The display update should occur through
display_throughput() as well.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-01 15:22:32 -07:00
Nicolas Pitre
93ff3f6a53 return the prune-packed progress display to the inner loop
This reverts commit 0e549137966feb016927a827fb6e359aec8264a3 so to return
to the same state as commit b5d72f0a4cd3cce945ca0d37e4fa0ebbfcdcdb52.

On Wed, 31 Oct 2007, Shawn O. Pearce wrote:
> During my testing with a 40,000 loose object case (yea, I fully
> unpacked a git.git clone I had laying around) my system stalled
> hard in the first object directory.  A *lot* longer than 1 second.
> So I got no progress meter for a long time, and then a progress
> meter appeared on the second directory.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-01 15:22:32 -07:00
Nicolas Pitre
2a128d63dc add throughput display to git-push
This one triggers only when git-pack-objects is called with
--all-progress and --stdout which is the combination used by
git-push.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Nicolas Pitre
74b6792f7b add some copyright notice to the progress display code
Some self patting on the back to keep my ego alive.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Nicolas Pitre
29e63ed3f6 add throughput display to index-pack
... and call it "Receiving objects" when over stdin to look clearer
to end users.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Nicolas Pitre
cf84d51c43 add throughput to progress display
This adds the ability for the progress code to also display transfer
throughput when that makes sense.

The math was inspired by commit c548cf4ee0737a321ffe94f6a97c65baf87281be
from Linus.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Nicolas Pitre
4d4fcc5451 relax usage of the progress API
Since it is now OK to pass a null pointer to display_progress() and
stop_progress() resulting in a no-op, then we can simplify the code
and remove a bunch of lines by not making those calls conditional all
the time.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Nicolas Pitre
dc6a0757c4 make struct progress an opaque type
This allows for better management of progress "object" existence,
as well as making the progress display implementation more independent
from its callers.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Nicolas Pitre
0e54913796 prune-packed: don't call display_progress() for every file
The progress count is per fanout directory, so it is useless to call
it for every file as the count doesn't change that often.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30 16:08:40 -07:00
Shawn O. Pearce
0e30404370 Stop displaying "Pack pack-$ID created." during git-gc
Discussion on the list tonight came to the conclusion that showing
the name of the packfile we just created during git-repack is not
a very useful message for any end-user.  For the really technical
folk who need to have the name of the newest packfile they can use
something such as `ls -t .git/objects/pack | head -2` to find the
most recently created packfile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-19 01:01:40 -04:00
Shawn O. Pearce
b5d72f0a4c Teach prune-packed to use the standard progress meter
Rather than reimplementing the progress meter logic and always
showing 100 lines of output while pruning already packed objects
we now use a delayed progress meter and only show it if there are
enough objects to make us take a little while.

Most users won't see the message anymore as it usually doesn't take
very long to delete the already packed loose objects.  This neatens
the output of a git-gc or git-repack execution, which is especially
important for a `git gc --auto` triggered from within another
command.

We perform the display_progress() call from within the very innermost
loop in case we spend more than 1 second within any single object
directory.  This ensures that a progress_update event from the
timer will still trigger in a timely fashion and allow the user to
see the progress meter.

While I'm in here I changed the message to be more descriptive of
its actual task.  "Removing unused objects" is a little scary for
new users as they wonder where these unused objects came from and
how they should avoid them.  Truth is these objects aren't unused
in the sense of what git-prune would call a dangling object, these
are used but are just duplicates of things we have already stored
in a packfile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-19 00:28:44 -04:00
Shawn O. Pearce
9c60a966f2 Change 'Deltifying objects' to 'Compressing objects'
Recently I was referred to the Grammar Police as the git-pack-objects
progress message 'Deltifying %u objects' is considered to be not
proper English to at least some small but vocal segment of the
English speaking population.  Techncially we are applying delta
compression to these objects at this stage, so the new term is
slightly more acceptable to the Grammar Police but is also just
as correct.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-18 23:34:09 -04:00
Nicolas Pitre
c85228ed8f fix for more minor memory leaks
Now that some pointers have lost their const attribute, we can free their
associated memory when done with them.  This is more a correctness issue
about the rule for freeing those pointers which isn't completely trivial
more than the leak itself which didn't matter as the program is
exiting anyway.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:54:57 -04:00
Nicolas Pitre
4049b9cfc0 fix const issues with some functions
Two functions, namely write_idx_file() and open_pack_file(), currently
return a const pointer.  However that pointer is either a copy of the
first argument, or set to a malloc'd buffer when that first argument
is null.  In the later case it is wrong to qualify that pointer as const
since ownership of the buffer is transferred to the caller to dispose of,
and obviously the free() function is not meant to be passed const
pointers.

Making the return pointer not const causes a warning when the first
argument is returned since that argument is also marked const.

The correct thing to do is therefore to remove the const qualifiers,
avoiding the need for ugly casts only to silence some warnings.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:54:57 -04:00
Nicolas Pitre
7ba502c47b pack-objects.c: fix some global variable abuse and memory leaks
To keep things well layered, sha1close() now returns the file descriptor
when it doesn't close the file.

An ugly cast was added to the return of write_idx_file() to avoid a
warning.  A proper fix will come separately.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:54:56 -04:00
Nicolas Pitre
2f8b89472c pack-objects: no delta possible with only one object in the list
... so don't even try in that case, and save another useless line of
progress display.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:54:56 -04:00
Nicolas Pitre
ed1902ef5c cope with multiple line breaks within sideband progress messages
A single sideband packet may sometimes contain multiple lines of progress
messages, but we prepend "remote: " only to the whole buffer which creates
a messed up display in that case.  Make sure that the "remote: " prefix
is applied to every remote lines.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:54:56 -04:00
Nicolas Pitre
42e18fbf5f more compact progress display
Each progress can be on a single line instead of two.

[sp: Changed "Checking files out" to "Checking out files" at
     Johannes Sixt's suggestion as it better explains the
	 action that is taking place]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:54:55 -04:00
Benoit Sigoure
207f1a75e7 git-svn: simplify the handling of fatal errors
* git-svn.perl (&fatal): Append the newline at the end of the error
	message.
	Adjust all callers.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:47:37 -04:00
Benoit Sigoure
51e057cf80 git-svn: add git svn proplist
This allows one to easily retrieve a list of svn properties from within
git-svn without requiring svn or knowing the URL of a repository.

	* git-svn.perl (%cmd): Add the command `proplist'.
	(&cmd_proplist): New.
	* t/t9101-git-svn-props.sh: Test git svn proplist.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:47:37 -04:00
Benoit Sigoure
1515345156 git-svn: add git svn propget
This allows one to easily retrieve a single SVN property from within
git-svn without requiring svn or remembering the URL of a repository

	* git-svn.perl (%cmd): Add the new command `propget'.
	($cmd_dir_prefix): New global.
	(&get_svnprops): New helper.
	(&cmd_propget): New.  Use &get_svnprops.
	* t/t9101-git-svn-props.sh: Add a test case for propget.

[ew: make sure the rev-parse --show-prefix call doesn't break
     the `git-svn clone' command]

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:47:37 -04:00
Benoit Sigoure
d05ddec51e git-svn: implement git svn create-ignore
git svn create-ignore (to create one .gitignore per directory
from the svn:ignore properties.  This has the disadvantage of
committing the .gitignore during the next dcommit, but when you
import a repo with tons of ignores (>1000), using git svn show-ignore
to build .git/info/exclude is *not* a good idea, because things like
git-status will end up doing >1000 fnmatch *per file* in the repo,
which leads to git-status taking more than 4s on my Core2Duo 2Ghz 2G
RAM)

	* git-svn.perl (%cmd): Add the new command `create-ignore'.
	(&cmd_create_ignore): New.
	* t/t9101-git-svn-props.sh: Adjust the test-case for show-ignore and
	add a test case for create-ignore.

[ew: added commit message from
  <05CAB148-56ED-4FF1-8AAB-4BA2A0B70C2C@lrde.epita.fr> ]

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:47:36 -04:00
Benoit Sigoure
01bdab84e3 git-svn: add a generic tree traversal to fetch SVN properties
* git-svn.perl (&traverse_ignore): Remove.
	(&prop_walk): New.
	(&cmd_show_ignore): Use prop_walk.

[ew: This will ease the implementation of the `create-ignore',
     `propget', and `proplist' commands]

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 02:47:36 -04:00
Luke Lu
ca5e949560 gitweb: speed up project listing on large work trees by limiting find depth
Signed-off-by: Luke Lu <git@vicaya.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17 01:23:33 -04:00
Shawn O. Pearce
317efa63fc Merge branch 'maint'
* maint:
  Document additional 1.5.3.5 fixes in release notes
  Avoid 'expr index' on Mac OS X as it isn't supported
  filter-branch: update current branch when rewritten
  fix filter-branch documentation
  helpful error message when send-pack finds no refs in common.
  Fix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE
  Correct typos in release notes for 1.5.3.5
2007-10-16 23:32:03 -04:00
Shawn O. Pearce
09955207d1 Document additional 1.5.3.5 fixes in release notes
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 23:31:58 -04:00
Michael Witten
54f0db79ca git-cvsexportcommit.perl: git-apply no longer needs --binary
Signed-off-by: Michael Witten <mfwitten@mit.edu>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 22:48:20 -04:00
Shawn O. Pearce
f5f30699c0 Avoid 'expr index' on Mac OS X as it isn't supported
This fixes git-instaweb so it can start an httpd without warning
about an invalid test command.  Yes its ugly, but its also quite
portable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 22:48:03 -04:00
Johannes Schindelin
46eb449cbe filter-branch: update current branch when rewritten
Earlier, "git filter-branch --<options> HEAD" would not update the
working tree after rewriting the branch.  This commit fixes it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 22:47:51 -04:00
Johannes Schindelin
8ef44519a6 fix filter-branch documentation
The man page for filter-branch still talked about writing the result
to the branch "newbranch".  This is hopefully the last place where the
old behaviour was described.

Noticed by Bill Lear.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 22:47:51 -04:00
Andrew Clausen
7e23b06d59 helpful error message when send-pack finds no refs in common.
Signed-off-by: Andrew Clausen <clausen@econ.upenn.edu>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 22:01:15 -04:00
Eygene Ryabinkin
fd499bcc9d git-svn: use "no warnings 'once'" to disable false-positives
Some variables coming from the Subversion's Perl bindings are used
in our code only once, so the interpreter warns us about it.  These
warnings are false-positives, because the variables themselves are
initialized in the binding's guts, that are made by SWIG.

Credits to Sam Vilain for his note about "no warnings 'once'".

[ew: minor formatting change]

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 20:33:13 -04:00
Johannes Schindelin
dd5c8af176 Fix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE
There are a few programs, such as config and diff, which allow running
without a git repository.  Therefore, they have to call
setup_git_directory_gently().

However, when GIT_DIR and GIT_WORK_TREE were set, and the current
directory was a subdirectory of the work tree,
setup_git_directory_gently() would return a bogus NULL prefix.

This patch fixes that.

Noticed by REPLeffect on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 20:18:04 -04:00
Shawn O. Pearce
33c8d38c78 Correct typos in release notes for 1.5.3.5
Noticed by Michele Ballabio.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 20:09:21 -04:00
Johannes Schindelin
9de6d07920 cvsexportcommit: get rid of temporary directory
Since commit e86ad71fe5f53ae4434566bd09ea4256090e5a3a we do not use
a temporary directory in cvsexportcommit.  So there is no need to set
one up.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 01:19:25 -04:00
Jeff King
ff9054627c git-rebase: document suppression of duplicate commits
git-rebase uses format-patch's --ignore-if-in-upstream
option, but we never document the user-visible behavior. The
example is placed near the top of the example list rather
than at the bottom because it is:
  a. a simple example
  b. a reasonably common scenario for many projects (mail
     some patches which get accepted upstream, then rebase)

[sp: Corrected direction of 'HEAD..<upstream>' set comparsion]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 01:18:43 -04:00
Michael Olson
5040beff0b Documentation/git-tag.txt: Document how to backdate tags
Added a new section beneath "On Automatic following" called "On
Backdating Tags".  This includes an explanation of when to use this
method, a brief explanation of the kind of date that can be used in
GIT_AUTHOR_DATE, and an example invocation of git-tag using a custom
setting of GIT_AUTHOR_DATE.

[sp: Corrected s/you/your/, noticed by Jeff King]

Signed-off-by: Michael W. Olson <mwolson@gnu.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 01:18:37 -04:00
Michael W. Olson
2858028e1a git-rebase--interactive.sh: Quote arguments to test
If /bin/sh is /bin/dash, then the script will display an error if
$parent_sha1 is undefined.  This patch works fixes the issue by
quoting both arguments to `test'.  Arguments composed solely of
variable expansions should always be quoted, unless we know for
certain that the contents are defined.

Signed-off-by: Michael W. Olson <mwolson@gnu.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16 00:59:17 -04:00
Shawn O. Pearce
d55e7c3acf Merge branch 'maint'
* maint:
  Whip post 1.5.3.4 maintenance series into shape.
  rebase -i: use diff plumbing instead of porcelain
  Do not remove distributed configure script
  git-archive: document --exec
  git-reflog: document --verbose
  git-config: handle --file option with relative pathname properly
  clear_commit_marks(): avoid deep recursion
  git add -i: Remove unused variables
  git add -i: Fix parsing of abbreviated hunk headers
  git-config: don't silently ignore options after --list
  Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT
  Fix embarrassing "git log --follow" bug

Conflicts:

	RelNotes
	git-rebase--interactive.sh
2007-10-15 22:31:47 -04:00
Shawn O. Pearce
8492f00b4f Whip post 1.5.3.4 maintenance series into shape.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:29:50 -04:00
Josh England
03618b9df8 Minor usage update in setgitperms.perl
Signed-off-by: Josh England <jjengla@sandia.gov>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:54 -04:00
Ralf Wildenhues
c90161586c manual: use 'URL' instead of 'url'.
Just for consistency, use the spelling URL everywhere.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:03 -04:00
Ralf Wildenhues
b6cbca3828 manual: add some markup.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:03 -04:00
Ralf Wildenhues
477ff5b71a manual: Fix example finding commits referencing given content.
If I'm handed a file, then it typically lives outside the
working directory.  git-log only operates on in-tree files,
so the first 'filename' should be an in-tree one, or it should
look at all files.  This patch does the latter, so it would
also find renamed files.  However, it is also slower.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:02 -04:00
Ralf Wildenhues
2c619db884 Fix wording in push definition.
Make the definition of push in the glossary readable.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:02 -04:00
Ralf Wildenhues
06ada1529c Fix some typos, punctuation, missing words, minor markup.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:02 -04:00
Ralf Wildenhues
2ef8ac1b2a manual: Fix or remove em dashes.
em dashes were used inconsistently in the manual.
This changes them to the way they are used in US English.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:11:01 -04:00
Brian Ewins
11f2441f05 Add a --dry-run option to git-push.
The default behaviour of git-push is potentially confusing
for new users, since it will push changes that are not on
the current branch. Publishing patches that were still
cooking on a development branch is hard to undo.

It would also be nice to be able to verify the expansion
of refspecs if you've edited them, so that you know
what branches matched on the server.

Adding a --dry-run flag allows the user to experiment
safely and learn how to use git-push properly. Originally
suggested by Steffen Prohaska.

Signed-off-by: Brian Ewins <brian.ewins@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:02:52 -04:00
Brian Ewins
a63103ae4f Add a --dry-run option to git-send-pack.
Implement support for --dry-run, so that it can be used
in calls from git-push. With this flag set, git-send-pack
will not send any updates to the server.

Signed-off-by: Brian Ewins <brian.ewins@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:02:52 -04:00