1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-06 01:03:02 +01:00
Commit graph

3569 commits

Author SHA1 Message Date
Junio C Hamano
6c1413a17e Merge branch 'kh/svnimport' into next
* kh/svnimport:
  svnimport: Read author names and emails from a file
2006-02-26 21:55:16 -08:00
Junio C Hamano
0a26233859 Merge branch 'lt/apply' into next
* lt/apply:
  apply --whitespace fixes and enhancements.
  The war on trailing whitespace
  svnimport: Convert the svn:ignore property
  svnimport: Convert executable flag
  svnimport: Mention -r in usage summary
  Make git diff-generation use a simpler spawn-like interface
2006-02-26 21:55:08 -08:00
Junio C Hamano
b5767dd660 apply --whitespace fixes and enhancements.
In addition to fixing obvious command line parsing bugs in the
previous round, this changes the following:

 * Adds "--whitespace=strip".  This applies after stripping the
   new trailing whitespaces introduced to the patch.

 * The output error message format is changed to say
   "patch-filename:linenumber:contents of the line".  This makes
   it similar to typical compiler error message format, and
   helps C-x ` (next-error) in Emacs compilation buffer.

 * --whitespace=error and --whitespace=warn do not stop at the
   first error.  We might want to limit the output to say first
   20 such lines to prevent cluttering, but on the other hand if
   you are willing to hand-fix after inspecting them, getting
   everything with a single run might be easier to work with.
   After all, somebody has to do the clean-up work somewhere.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 21:54:14 -08:00
Linus Torvalds
19bfcd5a14 The war on trailing whitespace
On Sat, 25 Feb 2006, Andrew Morton wrote:
>
> I'd suggest a) git will simply refuse to apply such a patch unless given a
> special `forcing' flag, b) even when thus forced, it will still warn and c)
> with a different flag, it will strip-then-apply, without generating a
> warning.

This doesn't do the "strip-then-apply" thing, but it allows you to make
git-apply generate a warning or error on extraneous whitespace.

Use --whitespace=warn to warn, and (surprise, surprise) --whitespace=error
to make it a fatal error to have whitespace at the end.

Totally untested, of course. But it compiles, so it must be fine.

HOWEVER! Note that this literally will check every single patch-line with
"+" at the beginning. Which means that if you fix a simple typo, and the
line had a space at the end before, and you didn't remove it, that's still
considered a "new line with whitespace at the end", even though obviously
the line wasn't really new.

I assume this is what you wanted, and there isn't really any sane
alternatives (you could make the warning activate only for _pure_
additions with no deletions at all in that hunk, but that sounds a bit
insane).

		Linus
2006-02-26 21:54:14 -08:00
Junio C Hamano
ef556367c2 Merge branch 'lt/rev-list' into next
* lt/rev-list:
  rev-list split: minimum fixup.
2006-02-26 21:53:56 -08:00
Karl Hasselström
36610b24f1 svnimport: Read author names and emails from a file
Read a file with lines on the form

  username User's Full Name <email@addres.org>

and use "User's Full Name <email@addres.org>" as the GIT author and
committer for Subversion commits made by "username". If encountering a
commit made by a user not in the list, abort.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 21:34:42 -08:00
Karl Hasselström
c55f3fff35 svnimport: Convert the svn:ignore property
Put the value of the svn:ignore property in a regular file when
converting a Subversion repository to GIT. The Subversion and GIT
ignore syntaxes are similar enough that it often just works to set the
filename to .gitignore and do nothing else.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 21:34:42 -08:00
Karl Hasselström
4802426ddb svnimport: Convert executable flag
Convert the svn:executable property to file mode 755 when converting
an SVN repository to GIT.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 21:34:42 -08:00
Karl Hasselström
525c0d713c svnimport: Mention -r in usage summary
I added the -r option to git-svnimport some time ago, but forgot to
update the usage summary in the documentation.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 21:34:41 -08:00
Junio C Hamano
d9cfb964c7 rev-list split: minimum fixup.
This fixes "the other end has commit X but since then we tagged
that commit with tag T, and he says he wants T -- what is the
list of objects we need to send him?" question:

	git-rev-list --objects ^X T

We ended up sending everything since the beginning of time X-<.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 21:19:14 -08:00
Linus Torvalds
8676eb4313 Make git diff-generation use a simpler spawn-like interface
Instead of depending of fork() and execve() and doing things in between
the two, make the git diff functions do everything up front, and then do
a single "spawn_prog()" invocation to run the actual external diff
program (if any is even needed).

This actually ends up simplifying the code, and should make it much
easier to make it efficient under broken operating systems (read: Windows).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 16:21:27 -08:00
Junio C Hamano
b5233a6195 Merge branch 'lt/rev-list' into next
* lt/rev-list:
  First cut at libifying revlist generation
  Merge branch 'maint'
  sample hooks template.
  Teach the "git" command to handle some commands internally
  Use setenv(), fix warnings
  contrib/git-svn: version 0.10.0
  contrib/git-svn: optimize sequential commits to svn
  contrib/git-svn: add show-ignore command
  annotate: Use qx{} for pipes on activestate.
  annotate: Convert all -| calls to use a helper open_pipe().
  annotate: Handle dirty state and arbitrary revisions.
  git-fetch: print the new and old ref when fast-forwarding
2006-02-26 15:33:49 -08:00
Linus Torvalds
ae563542bf First cut at libifying revlist generation
This really just splits things up partially, and creates the
interface to set things up by parsing the command line.

No real code changes so far, although the parsing of filenames is a bit
stricter. In particular, if there is a "--", then we do not accept any
filenames before it, and if there isn't any "--", then we check that _all_
paths listed are valid, not just the first one.

The new argument parsing automatically also gives us "--default" and
"--not" handling as in git-rev-parse.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:33:27 -08:00
Junio C Hamano
ac5f7c62c2 Merge branch 'maint'
* maint:
  sample hooks template.
2006-02-26 15:25:52 -08:00
Junio C Hamano
a204756a45 sample hooks template.
These two sample hooks try to detect and use the corresponding
commit hook from the same repository.  However, they forgot to
set up GIT_DIR for their own use, so was not in effect.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:16:41 -08:00
Linus Torvalds
231af8322a Teach the "git" command to handle some commands internally
This is another patch in the "prepare to do more in C" series, where the
git wrapper command is taught about the notion of handling some
functionality internally.

Right now, the only internal commands are "version" and "help", but the
point being that we can now easily extend it to handle some of the trivial
scripts internally. Things like "git log" and "git diff" wouldn't need
separate external scripts any more.

This also implies that to support the old "git-log" and "git-diff" syntax,
the "git" wrapper now automatically looks at the name it was executed as,
and if it is "git-xxxx", it will assume that it is to internally do what
"git xxxx" would do.

In other words, you can (once you implement an internal command) soft- or
hard-link that command to the "git" wrapper command, and it will do the
right thing, whether you use the "git xxxx" or the "git-xxxx" format.

There's one other change: the search order for external programs is
modified slightly, so that the first entry remains GIT_EXEC_DIR, but the
second entry is the same directory as the git wrapper itself was executed
out of - if we can figure it out from argv[0], of course.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:10:37 -08:00
Timo Hirvonen
962554c616 Use setenv(), fix warnings
- Fix -Wundef -Wold-style-definition warnings
  - Make pll_free() static

[jc: original patch by Timo had another unrelated bits:

  - Use setenv() instead of putenv()

 I'm postponing that part for now.]

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:06:45 -08:00
Eric Wong
3c0b7511cd contrib/git-svn: version 0.10.0
New features deserve an increment of the minor version.  This will very
likely become 1.0.0 unless release-critical bugs are found.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:04:59 -08:00
Eric Wong
e17512f3de contrib/git-svn: optimize sequential commits to svn
Avoid running 'svn up' to a previous revision if we know the
revision we just committed is the first descendant of the
revision we came from.

This reduces the time to do a series of commits by about 25%.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:02:45 -08:00
Eric Wong
8f22562c6b contrib/git-svn: add show-ignore command
Recursively finds and lists the svn:ignore property on
directories.  The output is suitable for appending to the
$GIT_DIR/info/exclude file.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 14:55:13 -08:00
Ryan Anderson
f60d46911d annotate: Use qx{} for pipes on activestate.
Note: This needs someone to tell me what the value of $^O is on ActiveState.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 14:45:22 -08:00
Ryan Anderson
6b3e21d603 annotate: Convert all -| calls to use a helper open_pipe().
When we settle on a solution for ActiveState's forking issues, all
compatibility checks can be handled inside this one function.

Also, fixed an abuse of global variables in the process of cleaning this up.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 14:45:05 -08:00
Ryan Anderson
87475f4dfc annotate: Handle dirty state and arbitrary revisions.
Also, use Getopt::Long and only process each rev once.

(Thanks to Morten Welinder for spotting the performance problems.)

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 14:43:55 -08:00
Lukas Sandström
9d7f73d43f git-fetch: print the new and old ref when fast-forwarding
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-25 12:03:18 -08:00
Junio C Hamano
ab57c8dd2a Merge branch 'master' into next
* master:
  fix warning from pack-objects.c
  Merge branches 'jc/rev-list' and 'jc/pack-thin'
  gitview: Fix the graph display .
2006-02-24 23:47:48 -08:00
Luck, Tony
8fcf1ad9c6 fix warning from pack-objects.c
When compiling on ia64 I get this warning (from gcc 3.4.3):

gcc -o pack-objects.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>'  pack-objects.c
pack-objects.c: In function `pack_revindex_ix':
pack-objects.c:94: warning: cast from pointer to integer of different size

A double cast (first to long, then to int) shuts gcc up, but is there
a better way?

[jc: Andreas Ericsson suggests to use ulong instead. ]

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 22:17:20 -08:00
Junio C Hamano
f0b0af1b04 Merge branches 'jc/rev-list' and 'jc/pack-thin'
* jc/rev-list:
  rev-list --objects: use full pathname to help hashing.
  rev-list --objects-edge: remove duplicated edge commit output.
  rev-list --objects-edge

* jc/pack-thin:
  pack-objects: hash basename and direname a bit differently.
  pack-objects: allow "thin" packs to exceed depth limits
  pack-objects: use full pathname to help hashing with "thin" pack.
  pack-objects: thin pack micro-optimization.
  Use thin pack transfer in "git fetch".
  Add git-push --thin.
  send-pack --thin: use "thin pack" delta transfer.
  Thin pack - create packfile with missing delta base.

Conflicts:

	pack-objects.c (taking "next")
	send-pack.c (taking "next")
2006-02-24 21:55:23 -08:00
Junio C Hamano
d55e0fff1f Merge branch 'master' into next
* master:
  Merge branches 'jc/rev-list' and 'jc/pack-thin'
  gitview: Code cleanup
  Add missing programs to ignore list
  git ls files recursively show ignored files
  Build and install git-mailinfo.
  gitview: Bump the rev
  gitview: Fix DeprecationWarning
2006-02-24 19:01:02 -08:00
Junio C Hamano
52e8a6e9bf Merge branches 'jc/rev-list' and 'jc/pack-thin'
* jc/rev-list:
  rev-list --objects: use full pathname to help hashing.
  rev-list --objects-edge: remove duplicated edge commit output.
  rev-list --objects-edge

* jc/pack-thin:
  pack-objects: hash basename and direname a bit differently.
  pack-objects: allow "thin" packs to exceed depth limits
  pack-objects: use full pathname to help hashing with "thin" pack.
  pack-objects: thin pack micro-optimization.
  Use thin pack transfer in "git fetch".
  Add git-push --thin.
  send-pack --thin: use "thin pack" delta transfer.
  Thin pack - create packfile with missing delta base.

Conflicts:

	pack-objects.c (manual adjustment for thin pack needed)
	send-pack.c
2006-02-24 18:55:25 -08:00
Aneesh Kumar K.V
1509bd9e69 gitview: Fix the graph display .
This fix all the known issue with the graph display
The bug need to be explained graphically

                                 |
                                 a
This line need not be there ---->| \
                                 b  |
                                 | /
                                 c

c is parent of a and all a,b and c are placed on the same line and b is child of c
With my last checkin I added  a seperate line to indicate that a is
connected to c. But then we had the line connecting a and b which should
not be ther. This changes fixes the same bug

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 17:27:46 -08:00
Aneesh Kumar K.V
9e4f522da7 gitview: Code cleanup
Rearrange the code little bit so that it is easier to read

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 17:27:39 -08:00
Shawn Pearce
6ee9240f63 Add missing programs to ignore list
Added recently added programs to the default exclude list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 16:16:39 -08:00
Shawn Pearce
1e3584053d git ls files recursively show ignored files
Make git-ls-files --others --ignored recurse into non-excluded
subdirectories.

Typically when asking git-ls-files to display all files which are
ignored by one or more exclude patterns one would want it to recurse
into subdirectories which are not themselves excluded to see if
there are any excluded files contained within those subdirectories.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 16:16:34 -08:00
Junio C Hamano
43f72af1bc Build and install git-mailinfo.
The merge 712b1dd389 was done
incorrectly, and lost this program from Makefile.

Big thanks go to Tony Luck for noticing it, and Linus for
diagnosing it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 16:16:10 -08:00
Aneesh Kumar
20d23f554d gitview: Bump the rev
Make the 0.7 release

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 03:14:44 -08:00
Aneesh Kumar
8b42f5ae54 gitview: Fix DeprecationWarning
DeprecationWarning: integer argument expected, got float

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 03:14:34 -08:00
Junio C Hamano
1b1ad31aa8 Merge branch 'master' into next
* master:
  Merge fixes early for next maint series.
  Merge branch 'fix' into maint
  git-am: do not allow empty commits by mistake.
2006-02-24 02:22:01 -08:00
Junio C Hamano
a68de9592e Merge fixes early for next maint series. 2006-02-24 02:21:28 -08:00
Junio C Hamano
6d5129ac09 Merge branch 'fix' into maint
* fix:
  git-am: do not allow empty commits by mistake.
2006-02-24 02:21:00 -08:00
Junio C Hamano
7465ef5155 Merge branches 'jc/rev-list' and 'jc/pack-thin' into next
* jc/rev-list:
  rev-list --objects: use full pathname to help hashing.

* jc/pack-thin:
  pack-objects: hash basename and direname a bit differently.
  pack-objects: allow "thin" packs to exceed depth limits
  pack-objects: use full pathname to help hashing with "thin" pack.
2006-02-24 01:56:38 -08:00
Junio C Hamano
4b953cdc04 Merge fix bits from jc/rev-list 2006-02-24 01:33:57 -08:00
Junio C Hamano
5ca5396c9e Merge branch 'np/delta' into next
* np/delta:
  Revert "diff-delta: produce optimal pack data"
  Tweak break/merge score to adjust to the new delta generation code.
  count-delta: fix counting of copied source.
2006-02-24 01:30:04 -08:00
Junio C Hamano
eae3fe5e50 Revert "diff-delta: produce optimal pack data"
This reverts 6b7d25d97b commit.

It turns out that the new algorithm has a really bad corner
case, that literally spends minutes for inputs that takes less
than a quater seconds to delta with the old algorithm.  The
resulting delta is 50% smaller which is admirable, but the
performance degradation is simply unacceptable for unconditional
use.

Some example cases are these blobs in Linux 2.6 repository:

    4917ec509720a42846d513addc11cbd25e0e3c4f
    9af06ba723df75fed49f7ccae5b6c9c34bc5115f
    dfc9cd58dc065d17030d875d3fea6e7862ede143

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 01:29:00 -08:00
Junio C Hamano
e6a933bdb7 Merge fixes from master 2006-02-24 01:14:41 -08:00
Junio C Hamano
eeef7135fe pack-objects: hash basename and direname a bit differently.
...so that "Makefile"s from different revs are sorted together,
separate from "t/Makefile"s, but close enough.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-23 23:51:01 -08:00
Junio C Hamano
e646de0d14 rev-list --objects: use full pathname to help hashing.
This helps to group the same files from different revs together,
while spreading files with the same basename in different
directories, to help pack-object.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-23 23:44:42 -08:00
Junio C Hamano
eb38cc689e rev-list --objects-edge: remove duplicated edge commit output.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-23 23:44:15 -08:00
Junio C Hamano
b76f6b6278 pack-objects: allow "thin" packs to exceed depth limits
When creating a new pack to be used in .git/objects/pack/
directory, we carefully count the depth of deltified objects to
be reused, so that the generated pack does not to exceed the
specified depth limit for runtime efficiency.  However, when we
are generating a thin pack that does not contain base objects,
such a pack can only be used during network transfer that is
expanded on the other end upon reception, so being careful and
artificially cutting the delta chain does not buy us anything
except increased bandwidth requirement.  This patch disables the
delta chain depth limit check when reusing an existing delta.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-23 23:04:52 -08:00
Junio C Hamano
3efaa937a5 Merge branch 'ar/win'
* ar/win:
  PATCH: simplify calls to git programs in git-fmt-merge-msg
2006-02-23 22:35:55 -08:00
Junio C Hamano
aa01568dc7 Merge branch 'jc/send-insane-refs'
* jc/send-insane-refs:
  send-pack: do not give up when remote has insanely large number of refs.
2006-02-23 22:34:39 -08:00