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

3230 commits

Author SHA1 Message Date
Junio C Hamano
f22fd75c6a git-diff: do not fall back on --cc when -[123], --ours etc. are given.
These flags ask diff with a specific unmerged stage, so it
should fall back on -p instead.  Also when -c is given, we
should not do --cc.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-06 11:22:07 -08:00
Junio C Hamano
a2c641c4ab Merge branch 'jc/diff'
* jc/diff:
  git-diff-tree --stdin: show all parents.
  combine-diff: remove misguided --show-empty hack.
2006-02-05 23:55:45 -08:00
Junio C Hamano
12db4852de Merge branches 'lt/show' and 'lt/revlist'
* lt/show:
  git-show

* lt/revlist:
  rev-parse lstat() workaround cleanup.
2006-02-05 23:55:09 -08:00
Junio C Hamano
a8c44537fe Merge branches 'jc/daemon' and 'mw/http'
* jc/daemon:
  daemon: extend user-relative path notation.
  daemon: Set SO_REUSEADDR on listening sockets.
  daemon: do not forbid user relative paths unconditionally under --base-path

* mw/http:
  http-fetch: Tidy control flow in process_alternate_response
  http: Turn on verbose Curl messages if GIT_CURL_VERBOSE set in environment
  http-fetch: Fix message reporting rename of object file.
  http-fetch: Fix object list corruption in fill_active_slots().
2006-02-05 23:54:14 -08:00
Junio C Hamano
45392a648d git-diff-tree --stdin: show all parents.
git-diff-tree --stdin ignored second and subsequent parents when
fed git-rev-list --parents output.  Update diff_tree_commit()
function to take a commit object, and pass a fabricated commit
object after grafting the fake parents from diff_tree_stdin().

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 23:00:41 -08:00
Junio C Hamano
e3c3a550d4 combine-diff: remove misguided --show-empty hack.
Now --always flag is available in diff-tree, there is no reason
to have that hack in the diffcore side.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 22:25:00 -08:00
Linus Torvalds
9ad0a93330 rev-parse lstat() workaround cleanup.
Earlier we had a workaround to avoid misspelled revision name to
be taken as a filename when "--no-revs --no-flags" are in
effect.  This cleans up the logic.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 21:49:42 -08:00
Ryan Anderson
2718435b7b git-send-email: Fully implement --quiet and document it.
Also reorganizes the man page to list options alphabetically.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 18:23:53 -08:00
Junio C Hamano
603968d22b daemon: extend user-relative path notation.
Earlier, we made --base-path to automatically forbid
user-relative paths, which was probably a mistake.  This
introduces --user-path (or --user-path=path) option to control
the use of user-relative paths independently.  The latter form
of the option can be used to restrict accesses to a part of each
user's home directory, similar to "public_html" some webservers
supports.

If we're invoked with --user-path=FOO option, then a URL of the
form git://~USER/PATH/... resolves to the path HOME/FOO/PATH/...,
where HOME is USER's home directory.

[jc: This is much reworked by me so bugs are mine, but the
 original patch was done by Mark Wooding.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:51:01 -08:00
Mark Wooding
1955fabf41 daemon: Set SO_REUSEADDR on listening sockets.
Without this, you can silently lose the ability to receive IPv4
connections if you stop and restart the daemon.

[jc: tweaked code organization a bit and made this controllable
 from a command line option.]

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:51:01 -08:00
Junio C Hamano
363f24c936 daemon: do not forbid user relative paths unconditionally under --base-path
Using base-path to relocate the server public space does not
have anything to do with allowing or forbidding user relative
paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:51:01 -08:00
Mark Wooding
a3f583cbf7 http-fetch: Tidy control flow in process_alternate_response
It's a bit convoluted.  Tidy it up.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:49:17 -08:00
Mark Wooding
7982d74e1c http: Turn on verbose Curl messages if GIT_CURL_VERBOSE set in environment
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:49:16 -08:00
Mark Wooding
7b934ec015 http-fetch: Fix message reporting rename of object file.
move_temp_to_file returns 0 or -1.  This is not a good thing to pass to
strerror(3).  Fortunately, someone already reported the error, so don't
worry too much.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:49:16 -08:00
Mark Wooding
09db444fdb http-fetch: Fix object list corruption in fill_active_slots().
In fill_active_slots() -- if we find an object which has already arrived,
say as part of a pack, /don't/ remove it from the list.  It's already been
prefetched and someone will ask for it later.  Just label it as done and
carry blithely on.  (As it was, the code would dereference a freed object
to continue through the list anyway.)

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:49:16 -08:00
Junio C Hamano
80d48ac623 git-show
This is essentially 'git whatchanged -n1 --always --cc "$@"'.
Just like whatchanged takes default flags from
whatchanged.difftree configuration, this uses show.difftree
configuration.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:42:49 -08:00
Junio C Hamano
df9892ffce git-diff: use --cc instead of -p.
The --cc output is much nicer when dealing with merges, so use
it by default.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:37:18 -08:00
Junio C Hamano
4abd89648e diff-index: make --cc a synonym for -p for now.
It could be made later to show unmerged state nicer than the
default as we did for diff-files later, but this would suffice
for now.  We would like to make --cc the default for 'git diff'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:36:12 -08:00
Linus Torvalds
ec0bdb6f1e diff-tree --always flag
It _might_ make sense for certain users like gitk and gitview if
we had a single tool that gives --pretty and its diff even if
the diff is empty.  Having said that, the flag --cc -m is too
specific.  If some uses want to see the commit log even for an
empty diff, that flag should not be something only --cc honors.

Here's an "--always" flag that does that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 13:46:19 -08:00
Peter Eriksen
04fe2a1706 Use adler32() from zlib instead of defining our own.
Since we already depend on zlib, we don't need to define our
own adler32().  Spotted by oprofile.

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 13:45:01 -08:00
Linus Torvalds
9523a4c2fc Fix git-rev-parse over-eager errors
Using "--verify" together with "--no-flags" makes perfect sense, but
git-rev-parse would complain about it when it saw a flag, even though it
would never actually use/output that flag.

This fixes it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 13:44:59 -08:00
Junio C Hamano
7334f06ce6 Do not fall back on vi on dumb terminals.
When TERM is set to 'dumb', do not start vi to edit the commit log
message.

Suggested by Amos Waterland.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-04 22:16:22 -08:00
Junio C Hamano
2d310d8a01 Merge branches 'jc/sha1', 'jc/diff' and 'jc/ws'
* jc/sha1:
  get_sha1_1: allow octopus^12 to be properly parsed.

* jc/diff:
  combine-diff: finishing touches to git-diff-tree --cc

* jc/ws:
  whitespace cleanup.
2006-02-03 23:52:20 -08:00
Jason Riedy
8361e1d4d3 Use sha1_file.c's mkdir-like routine in apply.c.
As far as I can see, create_subdirectories() in apply.c just
duplicates the functionality of safe_create_leading_directories() from
sha1_file.c.  The former has a warm, fuzzy const parameter, but that's
not important.

The potential problem with EEXIST and creating directories should
never occur here, but will be removed by future
safe_create_leading_directories() changes.  Other uses of EEXIST in
apply.c should be fine barring intentionally malicious behavior.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-03 23:35:14 -08:00
Mark Wooding
1fda3d557b daemon: Provide missing argument for logerror() call.
Could cause a crash if --base-path set.  Unlikely to be a security the
concern: message doesn't go to the client, so we can't leak anything
(except by dumping core), and we've already forked, so it's not a denial
of service.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-03 23:33:20 -08:00
Junio C Hamano
c0c74a88f9 git-merge: Properly quote $merge_msg variable.
Otherwise it would go though shell expansion...

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-03 19:41:33 -08:00
Junio C Hamano
0601dbe178 get_sha1_1: allow octopus^12 to be properly parsed.
We probably thought anybody who does more than 9 parents in an
Octopus is insane when this was initially done, but there is no
inherent reason to limit the number of independent topic
branches that happen to mature at the same time.

Our commit-tree allows up to 16 already, so at least we should
prepare to handle what we can produce, if only to be consistent.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 23:49:44 -08:00
Junio C Hamano
8fcf7f9af5 whitespace cleanup.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:54:24 -08:00
Junio C Hamano
f7a3d33f0f combine-diff: finishing touches to git-diff-tree --cc
This updates the output format to make administrative lines more
consistent with the traditional diffs.

The "index" line shows blob object names from each parents
(separated by commas), double dots and the object name of the
resulting blob.

The hunk header line begins with N+1 '@' characters for N-way
diff, the line number L of the first line in the hunk and line
count C from the parent in "-L,C" format for each parents and
then the line number of the first line in the hunk and line
count from the resulting file in "+L,C" format, and finally
N+1 '@' characters (earlier versions had the line numbers from
the resulting file at the beginning).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:53:26 -08:00
Junio C Hamano
46dc941246 combine-diff: cleanup.
The flag on the surviving lines meant "this parent is not
different" while the parent_map flag on the lost lines meant
"this parent is different", which was confusing.  So swap the
meaning of on-bit in the flag.  Also more heavily comment the
code.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:53:26 -08:00
Junio C Hamano
f16706cc59 combine-diff: show parent line numbers as well.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:53:26 -08:00
Junio C Hamano
b469d8b6f7 combine-diff: add a bit more comments.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:53:25 -08:00
Ryan Anderson
30d08b34aa git-send-email: Add --quiet to reduce some of the chatter when sending emails.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:52:51 -08:00
Ryan Anderson
d366c70376 Provide a more meaningful initial "From " line when using --compose in git-send-email.
git-send-email, when used with --compose, provided the user with a mbox-format
file to edit.  Some users, however, were confused by the leading, blank, "From
" line, so this change puts the value that will appear on the From: line of the
actual email on this line, along with a note that the line is ignored.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:52:50 -08:00
Junio C Hamano
6bfb27a0c5 commit.c: "Merge" fix in pretty_print_commit.
Earlier, f2d4227530 commit broke Merge:
lines for unabbreviated case.  Do not emit extra dots if we do not
abbreviate.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 17:52:19 -08:00
Fredrik Kuivinen
97f58b785d merge-recursive: Speed up commit graph construction
Use __slots__ to speed up construction and decrease memory consumption
of the Commit objects.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 12:30:51 -08:00
Fredrik Kuivinen
008bb6ea69 merge-recursive: Make use of provided bases
This makes some cases faster as we don't have to build the commit graph.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 12:30:51 -08:00
Junio C Hamano
985cb9cc58 Documentation: git-diff-tree --cc also omits empty commits
A misguided attempt to show logs at all time was inserted only to
the documentation of this flag.  Worse yet, it was not even implemented,
causing more confusion.  Drop it.

We might want to have an option to show --pretty even when there is no
diff output, but that is applicable to all forms of diff, not just --cc.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 11:28:38 -08:00
Junio C Hamano
823bcd6edc combine-diff: fix placement of deletion.
The code misplaced a raw hunk that consists of solely deleted
lines by one line.  This showed e.g. Len's 12-way octopus
(9fdb62af in the linux-2.6), kernel/power/disk.c, hunk starting
at line 95, incorrectly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 05:21:14 -08:00
Junio C Hamano
fd4b1d2193 combine-diff: add safety check to --cc.
The earlier change implemented "only two version" check but
without checking if the change rewrites from all the parents.
This implements a check to make sure that a change introduced
by the merge from all the parents is caught to be interesting.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 02:02:20 -08:00
Junio C Hamano
bf1c32bdec combine-diff: update --cc "uninteresting hunks" logic.
Earlier logic was discarding hunks that has difference from only
one parent or the same difference from all but one parent.  This
changes it to check if the differences on all lines are from the
same sets of parents.  This discards more uninteresting hunks
and seems to match expectations more naturally.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 02:02:20 -08:00
Junio C Hamano
3c39e9bdeb combine-diff: reuse diff from the same blob.
When dealing with an insanely large Octopus, it is possible to
optimize by noticing that more than one parents have the same
blob and avoid running diff between a parent and the merge
result by reusing an earlier result.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-02 02:02:20 -08:00
Petr Baudis
6a1f79c1f1 Allow diff and index commands to be interrupted
So far, e.g. git-update-index --refresh was basically uninterruptable
by ctrl-c, since it hooked the SIGINT handler, but that handler would
only unlink the lockfile but not actually quit. This makes it propagate
the signal to the default handler.

Note that I expected it to work without resetting the signal handler to
SIG_DFL, but without that it ended in an infinite loop of tgkill()s -
is my glibc violating SUS or what?

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-01 19:47:52 -08:00
Junio C Hamano
884944239f rev-list: omit duplicated parents.
Showing the same parent more than once for a commit does not
make much sense downstream, so stop it.

This can happen with an incorrectly made merge commit that
merges the same parent twice, but can happen in an otherwise
sane development history while squishing the history by taking
into account only commits that touch specified paths.

For example,

	$ git rev-list --max-count=1 --parents addafaf -- rev-list.c

would have to show this commit ancestry graph:

                  .---o---.
                 /         \
                .---*---o---.
               /    93b74bc  \
   ---*---o---o-----o---o-----o addafaf
      d8f6b34  \             /
                .---o---o---.
                 \         /
                  .---*---.
                      3815f42

where 5 independent development tracks, only two of which have
changes in the specified paths since they forked.  The last
change for the other three development tracks was done by the
same commit before they forked, and we were showing that three
times.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-01 19:47:26 -08:00
Junio C Hamano
2d49711512 update-index --index-info: allow stage 0 entries.
Somehow we did not allow stuffing the index with stage 0 entries
through --index-info interface.  I do not think of a reason to
forbid it offhand.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-01 19:45:55 -08:00
Sasha Khapyorsky
d9e2e12700 git-svnimport.perl: fix for 'arg list too long...'
This fixes 'arg list too long..' problem with git-ls-files.

Note that second arg list separation loop (with 'git-update-index') is
needed since git-ls-files arguments can be directories.

Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-01 14:23:47 -08:00
Nick Hengeveld
cb754fdf5a Use local structs for HTTP slot callback data
There's no need for these structures to be static, and it could potentially
cause problems down the road.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-31 18:03:46 -08:00
Eric Wong
8233340ce6 rev-list: allow -<n> as shorthand for --max-count=<n>
This builds on top of the previous one.

Traditionally, head(1) and tail(1) allow their line limits to be
parsed this way.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-31 16:23:03 -08:00
Eric Wong
3af06987eb rev-list: allow -n<n> as shorthand for --max-count=<n>
Both -n<n> and -n <n> are supported.  POSIX versions of head(1) and
tail(1) allow their line limits to be parsed this way.  I find
--max-count to be a commonly used option, and also similar in spirit to
head/tail, so I decided to make life easier on my worn out (and lazy :)
fingers with this patch.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-31 16:23:03 -08:00
Daniel Barkalow
e36f8b6034 Make apply accept the -pNUM option like patch does.
This only applies to traditional diffs, not to git diffs.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-31 16:22:01 -08:00