* Re: [PATCH] Be nice with compilers that do not support runtime paths at all.
From: Shawn O. Pearce @ 2007-10-22 6:44 UTC (permalink / raw)
To: Benoit SIGOURE; +Cc: git list
In-Reply-To: <09169ECD-19E1-44D1-8539-71EBBA3826A8@lrde.epita.fr>
Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
> >On Oct 4, 2007, at 1:18 AM, Junio C Hamano wrote:
> >>Benoit Sigoure <tsuna@lrde.epita.fr> writes:
> >>
> >>If we do not care about supporting too old GNU make, we can do
> >>this by first adding this near the top:
> >>
> >> ifndef NO_RPATH
> >> LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
> >> else
> >> LINKER_PATH = -L$(1)
> >> endif
> >>
> >>and then doing something like:
> >>
> >> CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
> >> OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))
> >>
> >>to make it easier to read and less error prone.
> >
> >Yes. I can rework the patch, but the question is: do you care
> >about old GNU make? Can I rewrite the patch with this feature?
>
> I know Junio is still offline but maybe someone else has an objection
> against this?
How old of a GNU make are talking about here? The above is certainly
a lot nicer to read, but I'd hate to suddenly ship a new Git that
someone cannot compile because their GNU make is too old.
GNU make is fortunately pretty easy to compile, so it shouldn't be
that difficult for someone to build a newer version if they had to,
but why make them go through all that extra work just to install
a new Git?
What about using a small helper shell script and using $(shell)
instead of $(call)?
So I guess in short I think I was in agreement with Junio a while
ago on this, which was that I don't want to require a newer GNU
make than we already require our users to have.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] "git help -a" should search all exec_paths and PATH
From: Shawn O. Pearce @ 2007-10-22 6:39 UTC (permalink / raw)
To: Scott Parish; +Cc: git
In-Reply-To: <20071022063201.GN16291@srparish.net>
Scott Parish <sRp@srparish.net> wrote:
> On Mon, Oct 22, 2007 at 01:30:17AM -0400, Shawn O. Pearce wrote:
>
> > fchdir() isn't as portable as Git currently is.
>
> I hadn't realized it wasn't portable, but i do see that there's no POSIX
> entry in its man page. I was actually looking to use getcwd, but its
> man page had suggested using this open()/fchdir() method.
>
> Anyway, is there a reason to avoid changing the directory? If not
> i'm tempted to take the approach that j.sixt suggested--not restoring
> the cwd since we're exiting anyway. I don't have any good reason
> to not do the string manipulation, but why do something more
> complicated then necessary?
Yea, that was another thought I had. You probably can just chdir(),
list, exit, and not worry about going back to the previous directory.
And more complicated is always a bad idea. Keep it simple, 'cause
us gits like it that way. :-)
--
Shawn.
^ permalink raw reply
* Re: [PATCH] "git help" and "git help -a" shouldn't exit(1) unless they error
From: Shawn O. Pearce @ 2007-10-22 6:37 UTC (permalink / raw)
To: Scott Parish; +Cc: git
In-Reply-To: <20071022061918.GM16291@srparish.net>
Scott Parish <sRp@srparish.net> wrote:
> On Mon, Oct 22, 2007 at 01:47:41AM -0400, Shawn O. Pearce wrote:
>
> > The issue here is t0000-basic.sh runs "../git" and tests that the
> > exit status is 1. If it isn't (the patch above makes it 0) we just
> > abort the test suite entirely.
>
> Shoot, i hadn't realized i had effected the "git" case. I'll
> look into this further.
>
> By the way, should i expect all the tests to pass from the unmodified
> public HEAD? (they don't for me)
Yes. I only push maint, master and next if they pass all tests.
If something doesn't pass I rewind the branch until it does (of
course I only rewind back to what I've previously published).
I do however push a broken pu. Because individual topics in there
may be valid, but one or two may also be broken. The pu branch
is meant to be a place to obtain a specific topic of interest
from so you can work further on it, or test it. Like tonight.
pu compiles but doesn't pass the tests.
So if you are seeing one or more tests fail please go run that
specific test(s) with "-i -v" and either come up with a fix for
the test, or at least post the output of that to the mailing
list so someone else can have a chance to resolve the problem.
Since everything passes here for me on Linux/x86_64 I'm guessing
its a platform specific issue. We still should fix it.
--
Shawn.
^ permalink raw reply
* What's cooking in git/spearce.git (topics)
From: Shawn O. Pearce @ 2007-10-22 6:32 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed
with '-' are only in 'pu' while commits prefixed with '+' are
in 'next'. The topics list the commits in reverse chronological
order.
* cc/skip (Mon Oct 22 07:49:39 2007 +0200) 9 commits
- Bisect: add a "bisect replay" test case.
- Bisect: add "bisect skip" to the documentation.
- Bisect: factorise "bisect_{bad,good,skip}" into "bisect_state".
- Bisect: factorise some logging into "bisect_write".
- Bisect: factorise "bisect_write_*" functions.
- Bisect: implement "bisect skip" to mark untestable revisions.
- Bisect: fix some white spaces and empty lines breakages.
- rev-list documentation: add "--bisect-all".
- rev-list: implement --bisect-all
Recently updated to use "skip". I haven't had a chance to look at
this series so it just parked in pu for now.
* ds/gitweb (Mon Oct 22 10:28:03 2007 +1000) 1 commit
+ gitweb: Provide title attributes for abbreviated author names.
* lt/rename (Sun Oct 21 16:59:03 2007 -0700) 2 commits
- Linear-time/space rename logic (exact renames only)
- Split out "exact content match" phase of rename detection
t4001-diff-rename.sh failed while running tests on pu. I'm pretty
sure its this topic from Linus. Need to look at it further.
* js/PATH (Sun Oct 21 22:59:01 2007 +0100) 1 commit
- execv_git_cmd(): also try PATH if everything else fails.
I raised a concern about GIT_EXEC_PATH="" making $PATH search before
the compiled in path, which is certainly new behavior and I don't
think its quite what was intended. Parked in pu until I hear back.
* sp/help-exit0 (Sun Oct 21 14:47:45 2007 -0700) 1 commit
. "git help" and "git help -a" shouldn't exit(1) unless they error
Breaks things because "git" (no arguments) no exits successful,
which is less than ideal. Only "git help" and "git help branch"
should be exiting successful.
* ja/shorthelp (Sun Oct 21 01:41:41 2007 +0300) 1 commit
+ On error, do not list all commands, but point to --help option
This I like. We'll see what the list thinks while using next. :)
* db/fetch-pack (Sat Oct 20 16:03:49 2007 -0400) 60 commits
+ Define compat version of mkdtemp for systems lacking it
+ Avoid scary errors about tagged trees/blobs during git-fetch
+ fetch: if not fetching from default remote, ignore default merge
+ Support 'push --dry-run' for http transport
+ Support 'push --dry-run' for rsync transport
+ Fix 'push --all branch...' error handling
+ Fix compilation when NO_CURL is defined
+ Added a test for fetching remote tags when there is not tags.
+ Fix a crash in ls-remote when refspec expands into nothing
... and many many more ...
I think this is just about ready to graduate to master. I haven't
seen any major problems with it since the recent fixes were put in.
I'd like to see it move over soon as a number of other topics
are based upon the tip of this topic rather than master itself.
But obviously code quality is more important than topic organization.
* js/forkexec (Fri Oct 19 21:48:06 2007 +0200) 74 commits
+ Use the asyncronous function infrastructure to run the content
filter.
+ Avoid a dup2(2) in apply_filter() - start_command() can do it for
us.
+ t0021-conversion.sh: Test that the clean filter really cleans
content.
+ upload-pack: Run rev-list in an asynchronous function.
+ upload-pack: Move the revision walker into a separate function.
+ Use the asyncronous function infrastructure in builtin-fetch-
pack.c.
+ Add infrastructure to run a function asynchronously.
+ upload-pack: Use start_command() to run pack-objects in
create_pack_file().
+ Have start_command() create a pipe to read the stderr of the
child.
+ Use start_comand() in builtin-fetch-pack.c instead of explicit
fork/exec.
+ Use run_command() to spawn external diff programs instead of
fork/exec.
+ Use start_command() to run content filters instead of explicit
fork/exec.
+ Use start_command() in git_connect() instead of explicit
fork/exec.
+ Change git_connect() to return a struct child_process instead of a
pid_t.
... db/fetch-pack begins here ...
This looked sane to me and makes it easier for the MinGW port.
Plus its an overal reduction in code, reusing the run-command
framework to avoid lots of ugly pipe() and dup2() calls. Its
parked in next for a while to get some testing but is probably
fine to move to master in the near future.
* tf/afs (Fri Oct 19 07:38:16 2007 -0500) 1 commit
- Better support AFS hardlinking across object directories
I'd rather rewrite this by putting the temporary files directly into
their final object directory, then hardlinking within that directory.
This should work on Coda and AFS, leaving only the FAT filesystem
as the odd-duck that needs to use rename(). But maybe I'm just
being really paranoid about not allowing an object to be replaced.
* jk/terse-fetch (Fri Oct 19 03:40:57 2007 -0400) 62 commits
- park
- git-fetch: mega-terse fetch output
... db/fetch-pack begins here ...
Much discussion on the list about this topic. I think we may have
come to an agreement about what the output should look like, but
this topic doesn't implement that output format. Someone needs to
either update this topic or rewrite it. Starting from Jeff King's
patch makes things a lot easier.
* np/progress (Fri Oct 19 01:01:40 2007 -0400) 9 commits
+ Stop displaying "Pack pack-$ID created." during git-gc
+ Teach prune-packed to use the standard progress meter
+ Change 'Deltifying objects' to 'Compressing objects'
+ fix for more minor memory leaks
+ fix const issues with some functions
+ pack-objects.c: fix some global variable abuse and memory leaks
+ pack-objects: no delta possible with only one object in the list
+ cope with multiple line breaks within sideband progress messages
+ more compact progress display
I really like the new progress display that Nico implemented here,
and also the terser and more user friendly output from git-repack.
Needs more time for testing, but its pretty obvious code changes
and should be able to graduate to master in the near future.
* sp/mergetool (Thu Oct 18 12:25:34 2007 +0200) 3 commits
+ mergetool: avoid misleading message "Resetting to default..."
+ mergetool: add support for ECMerge
+ mergetool: use path to mergetool in config var
mergetool.<tool>.path
Probably fine for master as-is. I personally don't use mergetool so
I'd appreciate an Ack from someone who does that these are working
well for them.
* jk/send-pack (Thu Oct 18 02:17:46 2007 -0400) 2 commits
+ t5516: test update of local refs on push
+ send-pack: don't update tracking refs on error
This probably should graduate to master soon. It just delays
updating the tracking refs until after we've made sure all refs
were updated. I'll give it a few more days and then likely kick
it over to master.
* js/rebase (Wed Oct 17 10:31:35 2007 +0100) 1 commit
+ Fixing path quoting in git-rebase
Simple change, but rebase is a key tool. I'll probably give this
a few more days and then kick it over.
* js/reflog-delete (Wed Oct 17 02:50:45 2007 +0100) 1 commit
+ Teach "git reflog" a subcommand to delete single entries
Waiting to hear if we're doing anything further with this. it was
originally created to help "git stash" perform a pop, but nobody
has come forth with a patch for git-stash that uses this feature.
I'd like to have a real use for it that actually tests this code
in a more production setting before it merges to master.
* dz/color-addi (Tue Oct 16 21:42:23 2007 -0400) 1 commit
- Add color support to git-add--interactive
I'm just parking this here in case anyone wants to pick this up and
continue it further. I described on list to the original author
a number of problems with why this isn't in next yet; the author
said they will need a little bit of time before they can address
that list.
* ph/parseopt (Mon Oct 15 23:06:02 2007 +0200) 22 commits
- Make builtin-pack-refs.c use parse_options.
- Make builtin-name-rev.c use parse_options.
- Make builtin-count-objects.c use parse_options.
- Make builtin-fsck.c use parse_options.
- Update manpages to reflect new short and long option aliases
- Make builtin-for-each-ref.c use parse-opts.
- Make builtin-symbolic-ref.c use parse_options.
- Make builtin-update-ref.c use parse_options
- Make builtin-revert.c use parse_options.
- Make builtin-describe.c use parse_options
- Make builtin-branch.c use parse_options.
- Make builtin-mv.c use parse-options
- Make builtin-rm.c use parse_options.
- Port builtin-add.c to use the new option parser.
- parse-options: allow callbacks to take no arguments at all.
- parse-options: Allow abbreviated options when unambiguous
- Add shortcuts for very often used options.
- parse-options: make some arguments optional, add callbacks.
- Rework make_usage to print the usage message immediately
- Add tests for parse-options.c
- parse-options: be able to generate usages automatically
- Add a simple option parser.
There's actually a few other commits (3?) missing from the above
list that are safely parked away in my tree. I'm most of the way
through reviewing these and have made a few bug fixes and style
nit corrections in the earlier parts of the series. I'm going to
try and finish working through this series tomorrow and then will
probably merge it to next.
The other 3 commits are hanging off to the side as 2 of them are
for the top of db/fetch-pack (to port builtin-fetch and friends
to the new option parser) and the 3rd is a somewhat questionable
change due to needing to rename a "-h" to a "-H". I just got
tired of rebasing these 3 other commits onto the respective topics.
I'm waiting for the core option parser (above) to freeze on a commit
SHA-1 before I deal with these again.
* sp/push-refspec (Sun Oct 14 10:54:45 2007 +0200) 6 commits
- push, send-pack: use same rules as git-rev-parse to resolve
refspecs
- add ref_cmp_full_short() comparing full ref name with a short name
- push, send-pack: support pushing HEAD to real ref name
- rev-parse: teach "git rev-parse --symbolic" to print the full ref
name
- add get_sha1_with_real_ref() returning full name of ref on demand
- push, send-pack: fix test if remote branch exists for colon-less
refspec
I've briefly looked at this series and there's reasons why its not
in next yet. Its actually something that I'm interested in seeing
fixed as the current behavior of how git-push matches refs on the
remote side is just plain nuts. I'll look at it further after I
get ph/parseopt and cc/skip into next.
* jc/spht (Tue Oct 2 18:00:27 2007 -0700) 1 commit
- git-diff: complain about >=8 consecutive spaces in initial indent
* jc/nu (Mon Oct 1 19:35:12 2007 -0700) 2 commits
- PARK a bit more work
- (PARK) WIP
I inherited these from Junio. No change.
* kh/commit (Mon Sep 17 20:06:47 2007 -0400) 4 commits
+ Export rerere() and launch_editor().
+ Introduce entry point add_interactive and add_files_to_cache
+ Enable wt-status to run against non-standard index file.
+ Enable wt-status output to a given FILE pointer.
Waiting on ph/parseopt (above) and other stuff for builtin-commit.
* jc/pathspec (Thu Sep 13 13:38:19 2007 -0700) 3 commits
- pathspec_can_match(): move it from builtin-ls-tree.c to tree.c
- ls-tree.c: refactor show_recursive() and rename it.
- tree-diff.c: split out a function to match a single pattern.
Also inherited from Junio. No change.
* js/stash-create (Mon Jul 9 00:51:23 2007 -0700) 2 commits
+ rebase: allow starting from a dirty tree.
+ stash: implement "stash create"
I actually had the "dirty work tree stash in rebase" thing trip on
me recently and I got a little pissed off about it. The behavior
was not what I expected, nor what I wanted, at that particular point
in time. Actually I wanted git-rebase to stop and *not* attempt
the rebase because of the dirty work tree. So I'm not feeling the
"auto stash" love right now.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] "git help -a" should search all exec_paths and PATH
From: Scott Parish @ 2007-10-22 6:32 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20071022053016.GN14735@spearce.org>
On Mon, Oct 22, 2007 at 01:30:17AM -0400, Shawn O. Pearce wrote:
> fchdir() isn't as portable as Git currently is. Thus far we have
> avoided using fchdir(). Requiring it here for something as "simple"
> as listing help is not a good improvement as it will limit who can
> run git-help. Why can't you stat the individual entries by joining
> the paths together?
I hadn't realized it wasn't portable, but i do see that there's no POSIX
entry in its man page. I was actually looking to use getcwd, but its
man page had suggested using this open()/fchdir() method.
Anyway, is there a reason to avoid changing the directory? If not
i'm tempted to take the approach that j.sixt suggested--not restoring
the cwd since we're exiting anyway. I don't have any good reason
to not do the string manipulation, but why do something more
complicated then necessary?
sRp
--
Scott Parish
http://srparish.net/
^ permalink raw reply
* Re: [PATCH] "git help" and "git help -a" shouldn't exit(1) unless they error
From: Scott Parish @ 2007-10-22 6:19 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20071022054741.GP14735@spearce.org>
On Mon, Oct 22, 2007 at 01:47:41AM -0400, Shawn O. Pearce wrote:
> The issue here is t0000-basic.sh runs "../git" and tests that the
> exit status is 1. If it isn't (the patch above makes it 0) we just
> abort the test suite entirely.
Shoot, i hadn't realized i had effected the "git" case. I'll
look into this further.
By the way, should i expect all the tests to pass from the unmodified
public HEAD? (they don't for me)
sRp
--
Scott Parish
http://srparish.net/
^ permalink raw reply
* What's in git/spearce.git (stable)
From: Shawn O. Pearce @ 2007-10-22 6:11 UTC (permalink / raw)
To: git
For those who may be new to the git/spearce.git concept I'm filling
in for Junio and have published a tree on repo.or.cz:
git://repo.or.cz/git/spearce.git
http://repo.or.cz/r/git/spearce.git
------
* The 'maint' branch has these fixes since the last announcement.
Alex Bennee (1):
Ensure we add directories in the correct order
Andrew Clausen (1):
helpful error message when send-pack finds no refs in common.
Brian Gernhardt (1):
cvsserver: Use exit 1 instead of die when req_Root fails.
Gerrit Pape (1):
git-config: print error message if the config file cannot be read
Jeff King (1):
send-pack: respect '+' on wildcard refspecs
Joakim Tjernlund (1):
Improve receive-pack error message about funny ref creation
Johannes Schindelin (3):
Fix setup_git_directory_gently() with relative GIT_DIR &
GIT_WORK_TREE
fix filter-branch documentation
filter-branch: update current branch when rewritten
Julian Phillips (1):
fast-import: Fix argument order to die in file_change_m
Linus Torvalds (4):
git-blame shouldn't crash if run in an unmerged tree
Avoid scary errors about tagged trees/blobs during git-fetch
Fix directory scanner to correctly ignore files without d_type
Fix diffcore-break total breakage
Patrick Welche (1):
Define NI_MAXSERV if not defined by operating system
Ralf Wildenhues (1):
gitk.txt: Fix markup.
Robert Schiele (1):
fixing output of non-fast-forward output of post-receive-email
Shawn O. Pearce (16):
git-gui: Display message box when we cannot find git in $PATH
git-gui: Handle starting on mapped shares under Cygwin
git-gui: Ensure .git/info/exclude is honored in Cygwin workdirs
git-gui: Allow gitk to be started on Cygwin with native Tcl/Tk
git-gui: Don't crash when starting gitk from a browser session
Correct typos in release notes for 1.5.3.5
Avoid 'expr index' on Mac OS X as it isn't supported
Document additional 1.5.3.5 fixes in release notes
Yet more 1.5.3.5 fixes mentioned in release notes
Avoid invoking diff drivers during git-stash
Further 1.5.3.5 fixes described in release notes
Paper bag fix diff invocation in 'git stash show'
git-gui: Correctly report failures from git-write-tree
git-gui: Handle progress bars from newer gits
git-gui: Don't display CR within console windows
Describe more 1.5.3.5 fixes in release notes
Simon Sasburg (1):
git-gui: Avoid using bold text in entire gui for some fonts
Steffen Prohaska (2):
git-gui: accept versions containing text annotations, like
1.5.3.mingw.1
attr: fix segfault in gitattributes parsing code
* The 'master' branch has these since the last announcement
in addition to the above.
Benoit Sigoure (5):
git-svn: add a generic tree traversal to fetch SVN properties
git-svn: implement git svn create-ignore
git-svn: add git svn propget
git-svn: add git svn proplist
git-svn: simplify the handling of fatal errors
Chris Pettitt (1):
git-p4 support for perforce renames.
Eygene Ryabinkin (1):
git-svn: use "no warnings 'once'" to disable false-positives
Jeff King (3):
git-gc: improve wording of --auto notification
Documentation/git-gc: explain --auto in description
Documentation/git-gc: improve description of --auto
Johannes Schindelin (1):
Deduce exec_path also from calls to git with a relative path
Johannes Sixt (1):
gitk: Do not pick up file names of "copy from" lines
Jonathan del Strother (1):
gitk: Add support for OS X mouse wheel
Junio C Hamano (2):
git-am: make the output quieter.
git-am: fix typo in the previous one.
Linus Torvalds (1):
optimize diffcore-delta by sorting hash entries.
Luke Lu (1):
gitweb: speed up project listing on large work trees by limiting
find depth
Marius Storm-Olsen (1):
Teach core.autocrlf to 'git blame'
Michael Witten (1):
git-cvsexportcommit.perl: git-apply no longer needs --binary
Paul Mackerras (3):
gitk: Check that we are running on at least Tcl/Tk 8.4
gitk: Avoid an error when cherry-picking if HEAD has moved on
gitk: Fix "can't unset prevlines(...)" Tcl error
Ralf Wildenhues (1):
git-cherry-pick: improve description of -x.
René Scharfe (1):
Correct some sizeof(size_t) != sizeof(unsigned long) typing errors
Sam Vilain (1):
gitk: disable colours when calling git log
Shawn O. Pearce (2):
Improved const correctness for strings
Use PRIuMAX instead of 'unsigned long long' in show-index
Simon Hausmann (1):
git-p4: When skipping a patch as part of "git-p4 submit" make sure
we correctly revert to the previous state of the files using
"p4 revert".
koreth@midwinter.com (1):
Add a message explaining that automatic GC is about to start
^ permalink raw reply
* Re: [PATCH] "git help -a" should search all exec_paths and PATH
From: Johannes Sixt @ 2007-10-22 6:06 UTC (permalink / raw)
To: Scott R Parish; +Cc: git
In-Reply-To: <20071021214846.GI16291@srparish.net>
Scott R Parish schrieb:
> + if (!dirp || chdir(dir)) {
> + fchdir(start_dir);
/me dislikes this. Windows doesn't have fchdir().
AFAIKS you are only using this to chdir back to where you started, but is
this necessary? Aren't we exiting anyway after the command list was printed?
-- Hannes
^ permalink raw reply
* Re: [PATCH 0/9] Bisect skip
From: Shawn O. Pearce @ 2007-10-22 6:02 UTC (permalink / raw)
To: Christian Couder; +Cc: Junio Hamano, Johannes Schindelin, git
In-Reply-To: <200710220747.28731.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> wrote:
> Here is the "bisect skip" patch series.
> It's just a rename from "dunno" to "skip" compared to the previous "dunno"
> patch series that was in Shawn's pu branch.
>
> In fact there is no change in the first 3 patches and trivial changes in the
> other patches.
Thanks. I'm reparking this new version in pu tonight. It is too
late in the morning here for me to go through this any further than
applying and merging. I'm almost done looking through and testing
the new option parser series and then will be looking at this one
next; probably Tuesday.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] "git help" and "git help -a" shouldn't exit(1) unless they error
From: Shawn O. Pearce @ 2007-10-22 5:47 UTC (permalink / raw)
To: Scott R Parish; +Cc: git
In-Reply-To: <20071021214744.GH16291@srparish.net>
Scott R Parish <srp@srparish.net> wrote:
> diff --git a/help.c b/help.c
> index 1cd33ec..b0d2dd4 100644
> --- a/help.c
> +++ b/help.c
> @@ -204,14 +204,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)
> if (!help_cmd) {
> printf("usage: %s\n\n", git_usage_string);
> list_common_cmds_help();
> - exit(1);
> + exit(0);
> }
Although it seems simple on the surface this patch breaks the
test suite:
$ make test
make -C t/ all
make[1]: Entering directory `/home/spearce/mygit/t'
*** t0000-basic.sh ***
You do not seem to have built git yet.
The issue here is t0000-basic.sh runs "../git" and tests that the
exit status is 1. If it isn't (the patch above makes it 0) we just
abort the test suite entirely.
I think its correct for "git help" to exit 0, and also for "git
help checkout" or "git checkout --help" to exit 0, but "git" by
itself with no subcommand should exit with an error, it requires a
subcommand to continue. So some sort of change is needed in git.c
to handle this special no subcommand condition.
--
Shawn.
^ permalink raw reply
* Re: .gittattributes handling has deficiencies
From: Steffen Prohaska @ 2007-10-22 5:45 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: david, git
In-Reply-To: <20071022050111.GL14735@spearce.org>
On Oct 22, 2007, at 7:01 AM, Shawn O. Pearce wrote:
> david@lang.hm wrote:
>> On Sun, 21 Oct 2007, Steffen Prohaska wrote:
>>> If a .gitattributes is in the work tree and we checkout a
>>> different head, the .gitattributes of the head we are switching
>>> to must have precedence.
>>>
>>> Maybe the gitattributes of a file should be part of the per-file
>>> flags in the index. Thus we could verify if the flags changed and
>>> if so, adjust the work tree accordig to the new flags. I'm
>>> lacking a deeper insight into the git internals. Therefore, I
>>> can't really say if the index is the right place. But it looks
>>> to me as if changing an attribute should be treated similar to a
>>> changing sha1, as far as the work tree is concerned.
>>
>> the problem with this is that each attribute ends up needing it's own
>> flag, which severely limits extending things (see the discussions
>> on file
>> permissions for examples). it's also much harder to manipulate
>> them then
>> in a file.
>
> Yea, you really don't want to copy .gitattributes into the per-file
> records in the index. That's not going to scale as more types of
> attributes are defined.
>
> Fortunately the .gitattributes file format was designed to be
> readable even when there's merge conflicts; that is it is a
> very simple line-oriented record format. One could difference
> the old .gitattributes currently found in the index against the
> .gitattributes we are switching to (from the target tree-ish),
> scan the lines removed/added, find which files those match against
> in the target tree-ish, and just add those files to the list of
> things we need to checkout.
>
> If any of those files is dirty then we just refuse the checkout,
> just as if the file was modified and we were switching branches.
> The user then needs to decide how to continue (probably stash the
> file and then restart the checkout).
Sounds like a reasonable plan. I have no time to look into this
right away.
> Rather simple IMHO. Of course I haven't gone into that part of
> read-tree recently, and the .gitattribute parser reads from the
> working directory, so you need to make sure you checkout the target
> .gitattributes file before anything else in the "to process list".
.gitattributes is first looked for in the working directory,
and if not there, .gitattributes is read from the index.
Steffen
^ permalink raw reply
* [PATCH 9/9] Bisect: add a "bisect replay" test case.
From: Christian Couder @ 2007-10-22 5:49 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
t/t6030-bisect-porcelain.sh | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index db82259..16d0c4a 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -167,6 +167,13 @@ test_expect_success 'bisect skip: add line and then a new test' '
git bisect skip &&
git bisect good > my_bisect_log.txt &&
grep "$HASH5 is first bad commit" my_bisect_log.txt &&
+ git bisect log > log_to_replay.txt
+ git bisect reset
+'
+
+test_expect_success 'bisect skip and bisect replay' '
+ git bisect replay log_to_replay.txt > my_bisect_log.txt &&
+ grep "$HASH5 is first bad commit" my_bisect_log.txt &&
git bisect reset
'
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 8/9] Bisect: add "bisect skip" to the documentation.
From: Christian Couder @ 2007-10-22 5:49 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Also fix "bisect bad" and "bisect good" short usage description.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Documentation/git-bisect.txt | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 1072fb8..785f381 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -16,8 +16,9 @@ The command takes various subcommands, and different options depending
on the subcommand:
git bisect start [<bad> [<good>...]] [--] [<paths>...]
- git bisect bad <rev>
- git bisect good <rev>
+ git bisect bad [<rev>]
+ git bisect good [<rev>...]
+ git bisect skip [<rev>...]
git bisect reset [<branch>]
git bisect visualize
git bisect replay <logfile>
@@ -134,6 +135,20 @@ $ git reset --hard HEAD~3 # try 3 revs before what
Then compile and test the one you chose to try. After that, tell
bisect what the result was as usual.
+Bisect skip
+~~~~~~~~~~~~
+
+Instead of choosing by yourself a nearby commit, you may just want git
+to do it for you using:
+
+------------
+$ git bisect skip # Current version cannot be tested
+------------
+
+But computing the commit to test may be slower afterwards and git may
+eventually not be able to tell the first bad among a bad and one or
+more "skip"ped commits.
+
Cutting down bisection by giving more parameters to bisect start
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 7/9] Bisect: factorise "bisect_{bad,good,skip}" into "bisect_state".
From: Christian Couder @ 2007-10-22 5:49 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-bisect.sh | 82 +++++++++++++++++++++-----------------------------------
1 files changed, 31 insertions(+), 51 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index d7f0a20..89f443b 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -134,47 +134,33 @@ bisect_write() {
test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
}
-bisect_bad() {
+bisect_state() {
bisect_autostart
- case "$#" in
- 0)
- rev=$(git rev-parse --verify HEAD) ;;
- 1)
- rev=$(git rev-parse --verify "$1^{commit}") ;;
+ state=$1
+ case "$#,$state" in
+ 0,*)
+ die "Please call 'bisect_state' with at least one argument." ;;
+ 1,bad|1,good|1,skip)
+ rev=$(git rev-parse --verify HEAD) ||
+ die "Bad rev input: HEAD"
+ bisect_write "$state" "$rev" ;;
+ 2,bad)
+ rev=$(git rev-parse --verify "$2^{commit}") ||
+ die "Bad rev input: $2"
+ bisect_write "$state" "$rev" ;;
+ *,good|*,skip)
+ shift
+ revs=$(git rev-parse --revs-only --no-flags "$@") &&
+ test '' != "$revs" || die "Bad rev input: $@"
+ for rev in $revs
+ do
+ rev=$(git rev-parse --verify "$rev^{commit}") ||
+ die "Bad rev commit: $rev^{commit}"
+ bisect_write "$state" "$rev"
+ done ;;
*)
usage ;;
- esac || exit
- bisect_write 'bad' "$rev"
- bisect_auto_next
-}
-
-bisect_good() {
- bisect_autostart
- case "$#" in
- 0) revs=$(git rev-parse --verify HEAD) || exit ;;
- *) revs=$(git rev-parse --revs-only --no-flags "$@") &&
- test '' != "$revs" || die "Bad rev input: $@" ;;
esac
- for rev in $revs
- do
- rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write 'good' "$rev"
- done
- bisect_auto_next
-}
-
-bisect_skip() {
- bisect_autostart
- case "$#" in
- 0) revs=$(git rev-parse --verify HEAD) || exit ;;
- *) revs=$(git rev-parse --revs-only --no-flags "$@") &&
- test '' != "$revs" || die "Bad rev input: $@" ;;
- esac
- for rev in $revs
- do
- rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write 'skip' "$rev"
- done
bisect_auto_next
}
@@ -404,24 +390,22 @@ bisect_run () {
exit $res
fi
- # Use "bisect_good" or "bisect_bad"
- # depending on run success or failure.
+ # Find current state depending on run success or failure.
if [ $res -gt 0 ]; then
- next_bisect='bisect_bad'
+ state='bad'
else
- next_bisect='bisect_good'
+ state='good'
fi
- # We have to use a subshell because bisect_good or
- # bisect_bad functions can exit.
- ( $next_bisect > "$GIT_DIR/BISECT_RUN" )
+ # We have to use a subshell because "bisect_state" can exit.
+ ( bisect_state $state > "$GIT_DIR/BISECT_RUN" )
res=$?
cat "$GIT_DIR/BISECT_RUN"
if [ $res -ne 0 ]; then
echo >&2 "bisect run failed:"
- echo >&2 "$next_bisect exited with error code $res"
+ echo >&2 "'bisect_state $state' exited with error code $res"
exit $res
fi
@@ -443,12 +427,8 @@ case "$#" in
case "$cmd" in
start)
bisect_start "$@" ;;
- bad)
- bisect_bad "$@" ;;
- good)
- bisect_good "$@" ;;
- skip)
- bisect_skip "$@" ;;
+ bad|good|skip)
+ bisect_state "$cmd" "$@" ;;
next)
# Not sure we want "next" at the UI level anymore.
bisect_next "$@" ;;
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* Re: [PATCH, take 1] Linear-time/space rename logic (exact renames only)
From: Linus Torvalds @ 2007-10-22 5:41 UTC (permalink / raw)
To: David Symonds
Cc: Git Mailing List, Junio C Hamano, Shawn O. Pearce, David Kastrup,
Jeff King
In-Reply-To: <ee77f5c20710211731n2646ae11jd2fb2c0be12494ac@mail.gmail.com>
On Mon, 22 Oct 2007, David Symonds wrote:
> > @@ -291,7 +291,7 @@ LIB_H = \
> > run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
> > tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \
> > utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \
> > - mailmap.h remote.h
> > + mailmap.h remote.h hash.o
>
> I assume that should be "hash.h", not "hash.o"?
Oops.
Yes.
Linus
^ permalink raw reply
* [PATCH 6/9] Bisect: factorise some logging into "bisect_write".
From: Christian Couder @ 2007-10-22 5:48 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Also use "die" instead of "echo >&2 something ; exit 1".
And simplify "bisect_replay".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-bisect.sh | 46 +++++++++++++---------------------------------
1 files changed, 13 insertions(+), 33 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 82aa404..d7f0a20 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -106,12 +106,11 @@ bisect_start() {
die "'$arg' does not appear to be a valid revision"
break
}
- if [ $bad_seen -eq 0 ]; then
- bad_seen=1
- bisect_write 'bad' "$rev"
- else
- bisect_write 'good' "$rev"
- fi
+ case $bad_seen in
+ 0) state='bad' ; bad_seen=1 ;;
+ *) state='good' ;;
+ esac
+ bisect_write "$state" "$rev" 'nolog'
shift
;;
esac
@@ -132,6 +131,7 @@ bisect_write() {
esac
echo "$rev" >"$GIT_DIR/refs/bisect/$tag"
echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+ test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
}
bisect_bad() {
@@ -145,7 +145,6 @@ bisect_bad() {
usage ;;
esac || exit
bisect_write 'bad' "$rev"
- echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
bisect_auto_next
}
@@ -160,7 +159,6 @@ bisect_good() {
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write 'good' "$rev"
- echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
@@ -176,7 +174,6 @@ bisect_skip() {
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write 'skip' "$rev"
- echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
@@ -352,10 +349,8 @@ bisect_reset() {
else
branch=master
fi ;;
- 1) git show-ref --verify --quiet -- "refs/heads/$1" || {
- echo >&2 "$1 does not seem to be a valid branch"
- exit 1
- }
+ 1) git show-ref --verify --quiet -- "refs/heads/$1" ||
+ die "$1 does not seem to be a valid branch"
branch="$1" ;;
*)
usage ;;
@@ -375,10 +370,7 @@ bisect_clean_state() {
}
bisect_replay () {
- test -r "$1" || {
- echo >&2 "cannot read $1 for replaying"
- exit 1
- }
+ test -r "$1" || die "cannot read $1 for replaying"
bisect_reset
while read bisect command rev
do
@@ -386,23 +378,11 @@ bisect_replay () {
case "$command" in
start)
cmd="bisect_start $rev"
- eval "$cmd"
- ;;
- good)
- bisect_write 'good' "$rev"
- echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
- ;;
- bad)
- bisect_write 'bad' "$rev"
- echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
- ;;
- skip)
- bisect_write 'skip' "$rev"
- echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
- ;;
+ eval "$cmd" ;;
+ good|bad|skip)
+ bisect_write "$command" "$rev" ;;
*)
- echo >&2 "?? what are you talking about?"
- exit 1 ;;
+ die "?? what are you talking about?" ;;
esac
done <"$1"
bisect_auto_next
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 5/9] Bisect: factorise "bisect_write_*" functions.
From: Christian Couder @ 2007-10-22 5:48 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-bisect.sh | 46 ++++++++++++++++++++--------------------------
1 files changed, 20 insertions(+), 26 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index cd46190..82aa404 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -108,9 +108,9 @@ bisect_start() {
}
if [ $bad_seen -eq 0 ]; then
bad_seen=1
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
else
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
fi
shift
;;
@@ -122,6 +122,18 @@ bisect_start() {
bisect_auto_next
}
+bisect_write() {
+ state="$1"
+ rev="$2"
+ case "$state" in
+ bad) tag="$state" ;;
+ good|skip) tag="$state"-"$rev" ;;
+ *) die "Bad bisect_write argument: $state" ;;
+ esac
+ echo "$rev" >"$GIT_DIR/refs/bisect/$tag"
+ echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+}
+
bisect_bad() {
bisect_autostart
case "$#" in
@@ -132,17 +144,11 @@ bisect_bad() {
*)
usage ;;
esac || exit
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
bisect_auto_next
}
-bisect_write_bad() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/bad"
- echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_good() {
bisect_autostart
case "$#" in
@@ -153,18 +159,12 @@ bisect_good() {
for rev in $revs
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
-bisect_write_good() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
- echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_skip() {
bisect_autostart
case "$#" in
@@ -175,18 +175,12 @@ bisect_skip() {
for rev in $revs
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write_skip "$rev"
+ bisect_write 'skip' "$rev"
echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
-bisect_write_skip() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/skip-$rev"
- echo "# skip: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_next_check() {
missing_good= missing_bad=
git show-ref -q --verify refs/bisect/bad || missing_bad=t
@@ -395,15 +389,15 @@ bisect_replay () {
eval "$cmd"
;;
good)
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
;;
bad)
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
;;
skip)
- bisect_write_skip "$rev"
+ bisect_write 'skip' "$rev"
echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
;;
*)
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 4/9] Bisect: implement "bisect skip" to mark untestable revisions.
From: Christian Couder @ 2007-10-22 5:48 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
When there are some "skip"ped revisions, we add the '--bisect-all'
option to "git rev-list --bisect-vars". Then we filter out the
"skip"ped revisions from the result of the rev-list command, and we
modify the "bisect_rev" var accordingly.
We don't always use "--bisect-all" because it is slower
than "--bisect-vars" or "--bisect".
When we cannot find for sure the first bad commit because of
"skip"ped commits, we print the hash of each possible first bad
commit and then we exit with code 2.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-bisect.sh | 125 ++++++++++++++++++++++++++++++++++++++++--
t/t6030-bisect-porcelain.sh | 71 ++++++++++++++++++++++++
2 files changed, 190 insertions(+), 6 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 436ccf6..cd46190 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -17,6 +17,8 @@ git bisect replay <logfile>
replay bisection log.
git bisect log
show bisect log.
+git bisect skip [<rev>...]
+ mark <rev>... untestable revisions.
git bisect run <cmd>...
use <cmd>... to automatically bisect.'
@@ -163,6 +165,28 @@ bisect_write_good() {
echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
}
+bisect_skip() {
+ bisect_autostart
+ case "$#" in
+ 0) revs=$(git rev-parse --verify HEAD) || exit ;;
+ *) revs=$(git rev-parse --revs-only --no-flags "$@") &&
+ test '' != "$revs" || die "Bad rev input: $@" ;;
+ esac
+ for rev in $revs
+ do
+ rev=$(git rev-parse --verify "$rev^{commit}") || exit
+ bisect_write_skip "$rev"
+ echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
+ done
+ bisect_auto_next
+}
+
+bisect_write_skip() {
+ rev="$1"
+ echo "$rev" >"$GIT_DIR/refs/bisect/skip-$rev"
+ echo "# skip: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+}
+
bisect_next_check() {
missing_good= missing_bad=
git show-ref -q --verify refs/bisect/bad || missing_bad=t
@@ -205,17 +229,97 @@ bisect_auto_next() {
bisect_next_check && bisect_next || :
}
+filter_skipped() {
+ _eval="$1"
+ _skip="$2"
+
+ if [ -z "$_skip" ]; then
+ eval $_eval
+ return
+ fi
+
+ # Let's parse the output of:
+ # "git rev-list --bisect-vars --bisect-all ..."
+ eval $_eval | while read hash line
+ do
+ case "$VARS,$FOUND,$TRIED,$hash" in
+ # We display some vars.
+ 1,*,*,*) echo "$hash $line" ;;
+
+ # Split line.
+ ,*,*,---*) ;;
+
+ # We had nothing to search.
+ ,,,bisect_rev*)
+ echo "bisect_rev="
+ VARS=1
+ ;;
+
+ # We did not find a good bisect rev.
+ # This should happen only if the "bad"
+ # commit is also a "skip" commit.
+ ,,*,bisect_rev*)
+ echo "bisect_rev=$TRIED"
+ VARS=1
+ ;;
+
+ # We are searching.
+ ,,*,*)
+ TRIED="${TRIED:+$TRIED|}$hash"
+ case "$_skip" in
+ *$hash*) ;;
+ *)
+ echo "bisect_rev=$hash"
+ echo "bisect_tried=\"$TRIED\""
+ FOUND=1
+ ;;
+ esac
+ ;;
+
+ # We have already found a rev to be tested.
+ ,1,*,bisect_rev*) VARS=1 ;;
+ ,1,*,*) ;;
+
+ # ???
+ *) die "filter_skipped error " \
+ "VARS: '$VARS' " \
+ "FOUND: '$FOUND' " \
+ "TRIED: '$TRIED' " \
+ "hash: '$hash' " \
+ "line: '$line'"
+ ;;
+ esac
+ done
+}
+
+exit_if_skipped_commits () {
+ _tried=$1
+ if expr "$_tried" : ".*[|].*" > /dev/null ; then
+ echo "There are only 'skip'ped commit left to test."
+ echo "The first bad commit could be any of:"
+ echo "$_tried" | sed -e 's/[|]/\n/g'
+ echo "We cannot bisect more!"
+ exit 2
+ fi
+}
+
bisect_next() {
case "$#" in 0) ;; *) usage ;; esac
bisect_autostart
bisect_next_check good
+ skip=$(git for-each-ref --format='%(objectname)' \
+ "refs/bisect/skip-*" | tr '[\012]' ' ') || exit
+
+ BISECT_OPT=''
+ test -n "$skip" && BISECT_OPT='--bisect-all'
+
bad=$(git rev-parse --verify refs/bisect/bad) &&
good=$(git for-each-ref --format='^%(objectname)' \
"refs/bisect/good-*" | tr '[\012]' ' ') &&
- eval="git rev-list --bisect-vars $good $bad --" &&
+ eval="git rev-list --bisect-vars $BISECT_OPT $good $bad --" &&
eval="$eval $(cat "$GIT_DIR/BISECT_NAMES")" &&
- eval=$(eval "$eval") &&
+ eval=$(filter_skipped "$eval" "$skip") &&
eval "$eval" || exit
if [ -z "$bisect_rev" ]; then
@@ -223,11 +327,16 @@ bisect_next() {
exit 1
fi
if [ "$bisect_rev" = "$bad" ]; then
+ exit_if_skipped_commits "$bisect_tried"
echo "$bisect_rev is first bad commit"
git diff-tree --pretty $bisect_rev
exit 0
fi
+ # We should exit here only if the "bad"
+ # commit is also a "skip" commit (see above).
+ exit_if_skipped_commits "$bisect_rev"
+
echo "Bisecting: $bisect_nr revisions left to test after this"
echo "$bisect_rev" >"$GIT_DIR/refs/heads/new-bisect"
git checkout -q new-bisect || exit
@@ -286,15 +395,17 @@ bisect_replay () {
eval "$cmd"
;;
good)
- echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
- echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+ bisect_write_good "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
;;
bad)
- echo "$rev" >"$GIT_DIR/refs/bisect/bad"
- echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+ bisect_write_bad "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
;;
+ skip)
+ bisect_write_skip "$rev"
+ echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
+ ;;
*)
echo >&2 "?? what are you talking about?"
exit 1 ;;
@@ -362,6 +473,8 @@ case "$#" in
bisect_bad "$@" ;;
good)
bisect_good "$@" ;;
+ skip)
+ bisect_skip "$@" ;;
next)
# Not sure we want "next" at the UI level anymore.
bisect_next "$@" ;;
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 03cdba5..db82259 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -71,6 +71,63 @@ test_expect_success 'bisect start with one bad and good' '
git bisect next
'
+# $HASH1 is good, $HASH4 is bad, we skip $HASH3
+# but $HASH2 is bad,
+# so we should find $HASH2 as the first bad commit
+test_expect_success 'bisect skip: successfull result' '
+ git bisect reset &&
+ git bisect start $HASH4 $HASH1 &&
+ git bisect skip &&
+ git bisect bad > my_bisect_log.txt &&
+ grep "$HASH2 is first bad commit" my_bisect_log.txt &&
+ git bisect reset
+'
+
+# $HASH1 is good, $HASH4 is bad, we skip $HASH3 and $HASH2
+# so we should not be able to tell the first bad commit
+# among $HASH2, $HASH3 and $HASH4
+test_expect_success 'bisect skip: cannot tell between 3 commits' '
+ git bisect start $HASH4 $HASH1 &&
+ git bisect skip || return 1
+
+ if git bisect skip > my_bisect_log.txt
+ then
+ echo Oops, should have failed.
+ false
+ else
+ test $? -eq 2 &&
+ grep "first bad commit could be any of" my_bisect_log.txt &&
+ ! grep $HASH1 my_bisect_log.txt &&
+ grep $HASH2 my_bisect_log.txt &&
+ grep $HASH3 my_bisect_log.txt &&
+ grep $HASH4 my_bisect_log.txt &&
+ git bisect reset
+ fi
+'
+
+# $HASH1 is good, $HASH4 is bad, we skip $HASH3
+# but $HASH2 is good,
+# so we should not be able to tell the first bad commit
+# among $HASH3 and $HASH4
+test_expect_success 'bisect skip: cannot tell between 2 commits' '
+ git bisect start $HASH4 $HASH1 &&
+ git bisect skip || return 1
+
+ if git bisect good > my_bisect_log.txt
+ then
+ echo Oops, should have failed.
+ false
+ else
+ test $? -eq 2 &&
+ grep "first bad commit could be any of" my_bisect_log.txt &&
+ ! grep $HASH1 my_bisect_log.txt &&
+ ! grep $HASH2 my_bisect_log.txt &&
+ grep $HASH3 my_bisect_log.txt &&
+ grep $HASH4 my_bisect_log.txt &&
+ git bisect reset
+ fi
+'
+
# We want to automatically find the commit that
# introduced "Another" into hello.
test_expect_success \
@@ -99,6 +156,20 @@ test_expect_success \
grep "$HASH4 is first bad commit" my_bisect_log.txt &&
git bisect reset'
+# $HASH1 is good, $HASH5 is bad, we skip $HASH3
+# but $HASH4 is good,
+# so we should find $HASH5 as the first bad commit
+HASH5=
+test_expect_success 'bisect skip: add line and then a new test' '
+ add_line_into_file "5: Another new line." hello &&
+ HASH5=$(git rev-parse --verify HEAD) &&
+ git bisect start $HASH5 $HASH1 &&
+ git bisect skip &&
+ git bisect good > my_bisect_log.txt &&
+ grep "$HASH5 is first bad commit" my_bisect_log.txt &&
+ git bisect reset
+'
+
#
#
test_done
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 3/9] Bisect: fix some white spaces and empty lines breakages.
From: Christian Couder @ 2007-10-22 5:48 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
git-bisect.sh | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 388887a..436ccf6 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -64,7 +64,7 @@ bisect_start() {
branch=`cat "$GIT_DIR/head-name"`
else
branch=master
- fi
+ fi
git checkout $branch || exit
;;
refs/heads/*)
@@ -95,11 +95,11 @@ bisect_start() {
arg="$1"
case "$arg" in
--)
- shift
+ shift
break
;;
*)
- rev=$(git rev-parse --verify "$arg^{commit}" 2>/dev/null) || {
+ rev=$(git rev-parse --verify "$arg^{commit}" 2>/dev/null) || {
test $has_double_dash -eq 1 &&
die "'$arg' does not appear to be a valid revision"
break
@@ -110,10 +110,10 @@ bisect_start() {
else
bisect_write_good "$rev"
fi
- shift
+ shift
;;
esac
- done
+ done
sq "$@" >"$GIT_DIR/BISECT_NAMES"
echo "git-bisect start$orig_args" >>"$GIT_DIR/BISECT_LOG"
@@ -143,7 +143,7 @@ bisect_write_bad() {
bisect_good() {
bisect_autostart
- case "$#" in
+ case "$#" in
0) revs=$(git rev-parse --verify HEAD) || exit ;;
*) revs=$(git rev-parse --revs-only --no-flags "$@") &&
test '' != "$revs" || die "Bad rev input: $@" ;;
@@ -153,7 +153,6 @@ bisect_good() {
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write_good "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
-
done
bisect_auto_next
}
@@ -207,7 +206,7 @@ bisect_auto_next() {
}
bisect_next() {
- case "$#" in 0) ;; *) usage ;; esac
+ case "$#" in 0) ;; *) usage ;; esac
bisect_autostart
bisect_next_check good
@@ -255,7 +254,7 @@ bisect_reset() {
exit 1
}
branch="$1" ;;
- *)
+ *)
usage ;;
esac
if git checkout "$branch"; then
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 2/9] rev-list documentation: add "--bisect-all".
From: Christian Couder @ 2007-10-22 5:48 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Documentation/git-rev-list.txt | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 7cd0e89..4852804 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -34,6 +34,7 @@ SYNOPSIS
[ \--pretty | \--header ]
[ \--bisect ]
[ \--bisect-vars ]
+ [ \--bisect-all ]
[ \--merge ]
[ \--reverse ]
[ \--walk-reflogs ]
@@ -354,6 +355,21 @@ the expected number of commits to be tested if `bisect_rev`
turns out to be bad to `bisect_bad`, and the number of commits
we are bisecting right now to `bisect_all`.
+--bisect-all::
+
+This outputs all the commit objects between the included and excluded
+commits, ordered by their distance to the included and excluded
+commits. The farthest from them is displayed first. (This is the only
+one displayed by `--bisect`.)
+
+This is useful because it makes it easy to choose a good commit to
+test when you want to avoid to test some of them for some reason (they
+may not compile for example).
+
+This option can be used along with `--bisect-vars`, in this case,
+after all the sorted commit objects, there will be the same text as if
+`--bisect-vars` had been used alone.
+
--
Commit Ordering
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 1/9] rev-list: implement --bisect-all
From: Christian Couder @ 2007-10-22 5:47 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
This is Junio's patch with some stuff to make --bisect-all
compatible with --bisect-vars.
This option makes it possible to see all the potential
bisection points. The best ones are displayed first.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
builtin-rev-list.c | 100 ++++++++++++++++++++++++++++++++++++++++++++-------
log-tree.c | 2 +-
log-tree.h | 1 +
3 files changed, 88 insertions(+), 15 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 33726b8..4439332 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -9,6 +9,7 @@
#include "revision.h"
#include "list-objects.h"
#include "builtin.h"
+#include "log-tree.h"
/* bits #0-15 in revision.h */
@@ -38,7 +39,8 @@ static const char rev_list_usage[] =
" --left-right\n"
" special purpose:\n"
" --bisect\n"
-" --bisect-vars"
+" --bisect-vars\n"
+" --bisect-all"
;
static struct rev_info revs;
@@ -74,6 +76,7 @@ static void show_commit(struct commit *commit)
parents = parents->next;
}
}
+ show_decorations(commit);
if (revs.commit_format == CMIT_FMT_ONELINE)
putchar(' ');
else
@@ -278,6 +281,57 @@ static struct commit_list *best_bisection(struct commit_list *list, int nr)
return best;
}
+struct commit_dist {
+ struct commit *commit;
+ int distance;
+};
+
+static int compare_commit_dist(const void *a_, const void *b_)
+{
+ struct commit_dist *a, *b;
+
+ a = (struct commit_dist *)a_;
+ b = (struct commit_dist *)b_;
+ if (a->distance != b->distance)
+ return b->distance - a->distance; /* desc sort */
+ return hashcmp(a->commit->object.sha1, b->commit->object.sha1);
+}
+
+static struct commit_list *best_bisection_sorted(struct commit_list *list, int nr)
+{
+ struct commit_list *p;
+ struct commit_dist *array = xcalloc(nr, sizeof(*array));
+ int cnt, i;
+
+ for (p = list, cnt = 0; p; p = p->next) {
+ int distance;
+ unsigned flags = p->item->object.flags;
+
+ if (revs.prune_fn && !(flags & TREECHANGE))
+ continue;
+ distance = weight(p);
+ if (nr - distance < distance)
+ distance = nr - distance;
+ array[cnt].commit = p->item;
+ array[cnt].distance = distance;
+ cnt++;
+ }
+ qsort(array, cnt, sizeof(*array), compare_commit_dist);
+ for (p = list, i = 0; i < cnt; i++) {
+ struct name_decoration *r = xmalloc(sizeof(*r) + 100);
+ struct object *obj = &(array[i].commit->object);
+
+ sprintf(r->name, "dist=%d", array[i].distance);
+ r->next = add_decoration(&name_decoration, obj, r);
+ p->item = array[i].commit;
+ p = p->next;
+ }
+ if (p)
+ p->next = NULL;
+ free(array);
+ return list;
+}
+
/*
* zero or positive weight is the number of interesting commits it can
* reach, including itself. Especially, weight = 0 means it does not
@@ -292,7 +346,8 @@ static struct commit_list *best_bisection(struct commit_list *list, int nr)
* or positive distance.
*/
static struct commit_list *do_find_bisection(struct commit_list *list,
- int nr, int *weights)
+ int nr, int *weights,
+ int find_all)
{
int n, counted;
struct commit_list *p;
@@ -351,7 +406,7 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
clear_distance(list);
/* Does it happen to be at exactly half-way? */
- if (halfway(p, nr))
+ if (!find_all && halfway(p, nr))
return p;
counted++;
}
@@ -389,19 +444,22 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
weight_set(p, weight(q));
/* Does it happen to be at exactly half-way? */
- if (halfway(p, nr))
+ if (!find_all && halfway(p, nr))
return p;
}
}
show_list("bisection 2 counted all", counted, nr, list);
- /* Then find the best one */
- return best_bisection(list, nr);
+ if (!find_all)
+ return best_bisection(list, nr);
+ else
+ return best_bisection_sorted(list, nr);
}
static struct commit_list *find_bisection(struct commit_list *list,
- int *reaches, int *all)
+ int *reaches, int *all,
+ int find_all)
{
int nr, on_list;
struct commit_list *p, *best, *next, *last;
@@ -434,14 +492,13 @@ static struct commit_list *find_bisection(struct commit_list *list,
weights = xcalloc(on_list, sizeof(*weights));
/* Do the real work of finding bisection commit. */
- best = do_find_bisection(list, nr, weights);
-
+ best = do_find_bisection(list, nr, weights, find_all);
if (best) {
- best->next = NULL;
+ if (!find_all)
+ best->next = NULL;
*reaches = weight(best);
}
free(weights);
-
return best;
}
@@ -468,6 +525,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
int i;
int read_from_stdin = 0;
int bisect_show_vars = 0;
+ int bisect_find_all = 0;
git_config(git_default_config);
init_revisions(&revs, prefix);
@@ -490,6 +548,11 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
bisect_list = 1;
continue;
}
+ if (!strcmp(arg, "--bisect-all")) {
+ bisect_list = 1;
+ bisect_find_all = 1;
+ continue;
+ }
if (!strcmp(arg, "--bisect-vars")) {
bisect_list = 1;
bisect_show_vars = 1;
@@ -536,9 +599,11 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (bisect_list) {
int reaches = reaches, all = all;
- revs.commits = find_bisection(revs.commits, &reaches, &all);
+ revs.commits = find_bisection(revs.commits, &reaches, &all,
+ bisect_find_all);
if (bisect_show_vars) {
int cnt;
+ char hex[41];
if (!revs.commits)
return 1;
/*
@@ -550,15 +615,22 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
* A bisect set of size N has (N-1) commits further
* to test, as we already know one bad one.
*/
- cnt = all-reaches;
+ cnt = all - reaches;
if (cnt < reaches)
cnt = reaches;
+ strcpy(hex, sha1_to_hex(revs.commits->item->object.sha1));
+
+ if (bisect_find_all) {
+ traverse_commit_list(&revs, show_commit, show_object);
+ printf("------\n");
+ }
+
printf("bisect_rev=%s\n"
"bisect_nr=%d\n"
"bisect_good=%d\n"
"bisect_bad=%d\n"
"bisect_all=%d\n",
- sha1_to_hex(revs.commits->item->object.sha1),
+ hex,
cnt - 1,
all - reaches - 1,
reaches - 1,
diff --git a/log-tree.c b/log-tree.c
index 62edd34..3763ce9 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -15,7 +15,7 @@ static void show_parents(struct commit *commit, int abbrev)
}
}
-static void show_decorations(struct commit *commit)
+void show_decorations(struct commit *commit)
{
const char *prefix;
struct name_decoration *decoration;
diff --git a/log-tree.h b/log-tree.h
index e82b56a..b33f7cd 100644
--- a/log-tree.h
+++ b/log-tree.h
@@ -12,5 +12,6 @@ int log_tree_diff_flush(struct rev_info *);
int log_tree_commit(struct rev_info *, struct commit *);
int log_tree_opt_parse(struct rev_info *, const char **, int);
void show_log(struct rev_info *opt, const char *sep);
+void show_decorations(struct commit *commit);
#endif
--
1.5.3.3.136.g591d1-dirty
^ permalink raw reply related
* [PATCH 0/9] Bisect skip
From: Christian Couder @ 2007-10-22 5:47 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Hi all,
Here is the "bisect skip" patch series.
It's just a rename from "dunno" to "skip" compared to the previous "dunno"
patch series that was in Shawn's pu branch.
In fact there is no change in the first 3 patches and trivial changes in the
other patches.
Thanks,
Christian.
^ permalink raw reply
* Re: .gittattributes handling has deficiencies
From: Steffen Prohaska @ 2007-10-22 5:38 UTC (permalink / raw)
To: david; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0710211703060.12998@asgard.lang.hm>
On Oct 22, 2007, at 2:05 AM, david@lang.hm wrote:
>
> by the way, I am not saying that my suggestion is the right way for
> things to be (especially long term), but I'm trying to figure out a
> work-around for the short term.
And I'm saying your proposed workaround is dangerous and doesn't
work reliably.
> I'm very interested to see the logn-term suggestions, becouse I
> suspect that modt of them could be leveraged for the metastore jobs.
I'd prefer this, too.
Steffen
^ permalink raw reply
* Re: [PATCH] "git help -a" should search all exec_paths and PATH
From: Shawn O. Pearce @ 2007-10-22 5:30 UTC (permalink / raw)
To: Scott R Parish; +Cc: git
In-Reply-To: <20071021214846.GI16291@srparish.net>
Scott R Parish <srp@srparish.net> wrote:
> Currently "git help -a" only searches in the highest priority exec_path,
> meaning at worst, nothing is listed if the git commands are only available
> from the PATH. It also makes git slightly less extensible.
...
> extern char **environ;
> static const char *builtin_exec_path = GIT_EXEC_PATH;
> -static const char *current_exec_path;
> +static const char *argv_exec_path;
>
> -void git_set_exec_path(const char *exec_path)
> +void git_set_argv_exec_path(const char *exec_path)
> {
> - current_exec_path = exec_path;
> + argv_exec_path = exec_path;
> }
I'd rather see a rename isolated from a logic change. I find
it easier to review.
> +const char *git_argv_exec_path(void)
> +const char *git_builtin_exec_path(void)
> +const char *git_env_exec_path(void)
And yet later you then build the same priority array as already used
by execv_git_cmd(). Why not just make a function that builds the
array for the caller, so both execv_git_cmd() and list_commands()
can both use the same array?
> +static unsigned int list_commands_in_dir(const char *dir, const char *prefix)
> {
> + int start_dir = open(".", O_RDONLY, 0);
...
> + if (!dirp || chdir(dir)) {
> + fchdir(start_dir);
fchdir() isn't as portable as Git currently is. Thus far we have
avoided using fchdir(). Requiring it here for something as "simple"
as listing help is not a good improvement as it will limit who can
run git-help. Why can't you stat the individual entries by joining
the paths together?
--
Shawn.
^ permalink raw reply
* Re: [PATCH] git-cherry-pick: improve description of -x.
From: Ralf Wildenhues @ 2007-10-22 5:19 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Frank Lichtenheld, git
In-Reply-To: <20071022051453.GM14735@spearce.org>
* Shawn O. Pearce wrote on Mon, Oct 22, 2007 at 07:14:53AM CEST:
>
> I think you are right that the current behavior of -x *not*
> including the prior commit SHA-1 in the case of a conflict is wrong.
> The problem however is that git-commit.sh doesn't get the data
> necessary to preseve the original author name/email/date/tz unless
> you use the "-c $id" option.
But the note added by -x is even missing when I add "-c $id" to
the git-commit command! That's the point I was trying to make,
and really the only thing that seemed weird to me.
Cheers,
Ralf
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox