git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* (no subject)
@ 2017-06-22  9:50 Jessie Hernandez
  2017-06-22 12:48 ` your mail Simon Ruderich
  0 siblings, 1 reply; 33+ messages in thread
From: Jessie Hernandez @ 2017-06-22  9:50 UTC (permalink / raw)
  To: git

subscribe git




^ permalink raw reply	[flat|nested] 33+ messages in thread
* (no subject)
@ 2020-06-24  0:38 shejan shuza
  2020-06-24  1:31 ` your mail brian m. carlson
  0 siblings, 1 reply; 33+ messages in thread
From: shejan shuza @ 2020-06-24  0:38 UTC (permalink / raw)
  To: git

Hi, I have a repository with about 55GB of contents, with binary files
that are less than 100MB each (so no LFS mode) from a project which
has almost filled up an entire hard drive. I am trying to add all of
the contents to a git repo and push it to GitHub but every time I do

git add .

in the folder with my contents after initializing and setting my
remote, git starts caching all the files to .git/objects, making the
.git folder grow in size rapidly. All the files are binaries, so git
cannot stage changes between versions anyway, so there is no reason to
cache versions.

Is there any way, such as editing the git attributes or changing
something about how files are staged in the git repository, to only
just add indexes or references to files in the repository rather than
cache them into the .git folder, while also being able to push all the
data to GitHub?

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (no subject)
@ 2019-11-20  3:49 Han-Wen Nienhuys
  2019-11-20  5:30 ` your mail Taylor Blau
  0 siblings, 1 reply; 33+ messages in thread
From: Han-Wen Nienhuys @ 2019-11-20  3:49 UTC (permalink / raw)
  To: git, Christian Couder, Johannes Schindelin

Hey folks,

I spent the last few weeks cobbling together an implementation of the
reftable format in C and in Go. I thought this would be cool to add to
git-core, but I doubt whether I will have enough time to see such an
effort through. Maybe some of you would want to try integrating it
into the Git-core code base?  Example code is here:

  https://github.com/google/reftable/blob/master/c/api.h#L153

cheers!
--
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (no subject)
@ 2019-07-11 20:11 Robert Morgan
  2019-07-11 20:18 ` your mail Kevin Daudt
  0 siblings, 1 reply; 33+ messages in thread
From: Robert Morgan @ 2019-07-11 20:11 UTC (permalink / raw)
  To: git

subscribe git

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (no subject)
@ 2019-01-25  9:47 Furkan DURUL
  2019-01-25 11:27 ` your mail Kevin Daudt
  0 siblings, 1 reply; 33+ messages in thread
From: Furkan DURUL @ 2019-01-25  9:47 UTC (permalink / raw)
  To: git

Hello,
My name is Furkan. I'm a new graduated Electronics and Communication
Engineer in Turkey. In my current workplace, we use Git in all our
projects and I really learned a lot from your Pro Git Book. I would
like to contribute to translation of this book to Turkish. I'm also a
freelance translator and have experience about translation.
Look forward to hear you
Cheers

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (unknown), 
@ 2016-04-11 19:04 miwilliams
  2016-04-11 19:13 ` your mail Jeff King
  0 siblings, 1 reply; 33+ messages in thread
From: miwilliams @ 2016-04-11 19:04 UTC (permalink / raw)
  To: git

 From 7201fe08ede76e502211a781250c9a0b702a78b2 Mon Sep 17 00:00:00 2001
From: Mike Williams <miwilliams@google.com>
Date: Mon, 11 Apr 2016 14:18:39 -0400
Subject: [PATCH 1/1] wt-status: Remove '!!' from  
wt_status_collect_changed_cb

The wt_status_collect_changed_cb function uses an extraneous double  
negation (!!)
when determining whether or not a submodule has new commits.

Signed-off-by: Mike Williams <miwilliams@google.com>
---
  wt-status.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wt-status.c b/wt-status.c
index ef74864..b955179 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -431,7 +431,7 @@ static void wt_status_collect_changed_cb(struct  
diff_queue_struct *q,
  			d->worktree_status = p->status;
  		d->dirty_submodule = p->two->dirty_submodule;
  		if (S_ISGITLINK(p->two->mode))
-			d->new_submodule_commits = !!hashcmp(p->one->sha1, p->two->sha1);
+			d->new_submodule_commits = hashcmp(p->one->sha1, p->two->sha1);
  	}
  }

-- 
2.8.0

^ permalink raw reply related	[flat|nested] 33+ messages in thread
* (unknown), 
@ 2013-05-17 18:02 ASHISH VERMA
  2013-05-21 13:13 ` your mail Magnus Bäck
  0 siblings, 1 reply; 33+ messages in thread
From: ASHISH VERMA @ 2013-05-17 18:02 UTC (permalink / raw)
  To: git

Hi,  i am using git to push my code from eclipse to heroku , but
recently iam  getting error like::

master:master rejected:non fast forward

and i am not able to resolve it .I tried a git pull but that says -
conflicts shud be resolved before git pull can be implemented.I can;t
find the solution Please help ASAP...



ASHISH

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (unknown), 
@ 2012-05-06 14:17 Bruce Zu
  2012-05-06 17:04 ` your mail Marcus Karlsson
  0 siblings, 1 reply; 33+ messages in thread
From: Bruce Zu @ 2012-05-06 14:17 UTC (permalink / raw)
  To: git

I want subscribe this git mail list
thanks!
Bruce Zu

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (unknown), 
@ 2008-08-13 14:54 aneesh.kumar
  2008-08-13 15:16 ` your mail Aneesh Kumar K.V
  0 siblings, 1 reply; 33+ messages in thread
From: aneesh.kumar @ 2008-08-13 14:54 UTC (permalink / raw)
  To: pasky; +Cc: git, Aneesh Kumar K.V

From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>

topgit: Implement tg-import

This can be used to import a set of commits
between range specified by range1..range2
This should help us to convert an already
existing quilt, stgit branches to topgit
managed one

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>

---
 Makefile     |    2 +-
 README       |    7 ++++++
 tg-create.sh |   22 ++++++++----------
 tg-export.sh |    2 +-
 tg-import.sh |   68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 87 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 6eade1e..95624ac 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ sharedir = $(PREFIX)/share/topgit
 hooksdir = $(cmddir)/hooks
 
 
-commands_in = tg-create.sh tg-delete.sh tg-export.sh tg-info.sh tg-patch.sh tg-summary.sh tg-update.sh
+commands_in = tg-create.sh tg-delete.sh tg-export.sh tg-info.sh tg-patch.sh tg-summary.sh tg-update.sh tg-import.sh
 hooks_in = hooks/pre-commit.sh
 
 commands_out = $(patsubst %.sh,%,$(commands_in))
diff --git a/README b/README
index b58a1b4..8b8f4d7 100644
--- a/README
+++ b/README
@@ -330,6 +330,13 @@ tg export
 	TODO: Make stripping of [PATCH] and other prefixes configurable
 	TODO: --mbox option for other mode of operation
 
+tg import
+~~~~~~~~
+	Import the commits between the given revision range into
+	a topgit managed branch
+
+	Usage: tg import rev1..rev2
+
 tg update
 ~~~~~~~~~
 	Update the current topic branch wrt. changes in the branches
diff --git a/tg-create.sh b/tg-create.sh
index 939af33..6cce7ed 100644
--- a/tg-create.sh
+++ b/tg-create.sh
@@ -31,17 +31,18 @@ done
 
 deps="${deps# }"
 if [ -z "$deps" ]; then
-	if [ -z "$name" -a -s "$git_dir/top-name" -a -s "$git_dir/top-deps" -a -s "$git_dir/top-merge" ]; then
-		# We are setting up the base branch now; resume merge!
-		name="$(cat "$git_dir/top-name")"
+	head="$(git symbolic-ref HEAD)"
+	bname="${head#refs/top-bases/}"
+	if [ "$bname" != "$head" -a -s "$git_dir/top-deps" -a -s "$git_dir/top-merge" ]; then
+		# We are on a base branch now; resume merge!
 		deps="$(cat "$git_dir/top-deps")"
 		merge="$(cat "$git_dir/top-merge")"
+		name="$bname"
 		restarted=1
 		info "Resuming $name setup..."
 	else
 		# The common case
 		[ -z "$name" ] && die "no branch name given"
-		head="$(git symbolic-ref HEAD)"
 		deps="${head#refs/heads/}"
 		[ "$deps" != "$head" ] || die "refusing to auto-depend on non-head ref ($head)"
 		info "Automatically marking dependency on $deps"
@@ -58,7 +59,7 @@ done
 	die "branch '$name' already exists"
 
 # Clean up any stale stuff
-rm -f "$git_dir/top-name" "$git_dir/top-deps" "$git_dir/top-merge"
+rm -f "$git_dir/top-deps" "$git_dir/top-merge"
 
 
 ## Create base
@@ -68,8 +69,7 @@ if [ -n "$merge" ]; then
 	branch="${merge%% *}"
 	merge="${merge#* }"
 	info "Creating $name base from $branch..."
-	# We create a detached head so that we can abort this operation
-	git checkout -q "$(git rev-parse "$branch")"
+	switch_to_base "$name" "$branch"
 fi
 
 
@@ -83,10 +83,9 @@ while [ -n "$merge" ]; do
 
 	if ! git merge "$branch"; then
 		info "Please commit merge resolution and call: tg create"
-		info "It is also safe to abort this operation using:"
-		info "git reset --hard some_branch"
-		info "(You are on a detached HEAD now.)"
-		echo "$name" >"$git_dir/top-name"
+		info "It is also safe to abort this operation using \`git reset --hard\`"
+		info "but please remember you are on the base branch now;"
+		info "you will want to switch to a different branch."
 		echo "$deps" >"$git_dir/top-deps"
 		echo "$merge" >"$git_dir/top-merge"
 		exit 2
@@ -96,7 +95,6 @@ done
 
 ## Set up the topic branch
 
-git update-ref "refs/top-bases/$name" "HEAD" ""
 git checkout -b "$name"
 
 echo "$deps" | sed 's/ /\n/g' >"$root_dir/.topdeps"
diff --git a/tg-export.sh b/tg-export.sh
index 62361dd..73ad2ef 100644
--- a/tg-export.sh
+++ b/tg-export.sh
@@ -190,7 +190,7 @@ recurse_deps driver "$name"
 
 
 if [ "$driver" = "collapse" ]; then
-	git update-ref "refs/heads/$output" "$(cat "$playground/$name")" ""
+	git update-ref "refs/heads/$output" "$(cat "$playground/$name")"
 
 	depcount="$(cat "$playground/^ticker" | wc -l)"
 	echo "Exported topic branch $name (total $depcount topics) to branch $output"
diff --git a/tg-import.sh b/tg-import.sh
new file mode 100644
index 0000000..6c991c5
--- /dev/null
+++ b/tg-import.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# TopGit - A different patch queue manager
+# GPLv2
+
+
+tg_get_commit_msg()
+{
+	commit="$1"
+	git log -1 --pretty=format:"From: %an <%ae>%n%n%s%n%n%b" "$commit"
+}
+
+tg_get_branch_name()
+{
+	# nice sed script from git-format-patch.sh
+	commit="$1"
+	titleScript='
+	s/[^-a-z.A-Z_0-9]/-/g
+        s/\.\.\.*/\./g
+	s/\.*$//
+	s/--*/-/g
+	s/^-//
+	s/-$//
+	q
+'
+	git log -1 --pretty=format:"%s" "$commit" | sed -e "$titleScript"
+}
+
+tg_process_commit()
+{
+	commit="$1"
+	branch_name=$(tg_get_branch_name "$commit")
+	echo "Importing $commit to $branch_name"
+	tg create tp/"$branch_name"
+	git read-tree "$commit"
+	tg_get_commit_msg "$commit" > .topmsg
+	git add -f .topmsg .topdeps
+	git commit -C "$commit"
+}
+
+# nice arg verification stolen from git-format-patch.sh
+for revpair
+do
+	case "$revpair" in
+	?*..?*)
+		rev1=`expr "z$revpair" : 'z\(.*\)\.\.'`
+		rev2=`expr "z$revpair" : 'z.*\.\.\(.*\)'`
+		;;
+	*)
+		die "Unknow range spec $revpair"
+		;;
+	esac
+	git rev-parse --verify "$rev1^0" >/dev/null 2>&1 ||
+		die "Not a valid rev $rev1 ($revpair)"
+	git rev-parse --verify "$rev2^0" >/dev/null 2>&1 ||
+		die "Not a valid rev $rev2 ($revpair)"
+	git cherry -v "$rev1" "$rev2" |
+	while read sign rev comment
+	do
+		case "$sign" in
+		'-')
+			info "Merged already: $comment"
+			;;
+		*)
+			tg_process_commit "$rev"
+			;;
+		esac
+	done
+done
-- 
tg: (f27e693..) tp/topgit-Implement-tg-import (depends on: master)

^ permalink raw reply related	[flat|nested] 33+ messages in thread
* [PATCH 0/6] builtin-remote
@ 2007-12-05 19:00 Johannes Schindelin
  2007-12-05 19:00 ` (unknown) Johannes Schindelin
  0 siblings, 1 reply; 33+ messages in thread
From: Johannes Schindelin @ 2007-12-05 19:00 UTC (permalink / raw)
  To: git, gitster

Hi,

this series introduces remote as a builtin, and fixes a long-standing bug 
(if you created a remote with --mirror, prune would not do the right 
thing).

I know it is pretty late in the game for 1.5.4, but then, I do not expect 
this to go into that version...

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (unknown), 
@ 2007-10-13  4:01 Michael Witten
  2007-10-13  4:07 ` your mail Jeff King
  0 siblings, 1 reply; 33+ messages in thread
From: Michael Witten @ 2007-10-13  4:01 UTC (permalink / raw)
  To: git; +Cc: Jeff King

I apologize if this is received twice.
I did add some comments, though!



On 12 Oct 2007, at 10:49:10 PM, Jeff King wrote:
> You are presumably doing a 'git-pull' on the cvsimport-ed commits. Try
> doing a git-rebase, which will filter out commits which make the same
> changes. Yes, it means throwing away your original commits, but the  
> new
> ones should be morally equivalent (and are now the "official" upstream
> of the CVS repository).

Now that you mention it, I think the best approach would be to:
	
	(1) cvsexportcommit
	(2) git reset --hard LAST_CVS_IMPORT_AND_MERGE
	(3) git cvsimport ..... # and merge

I think this is what you mean; it seems to me that rebasing isn't  
quite that.

However, this will not preserve more complicated history such as merges
from another git repository.

Basically, I want to treat my git repository as the official  
repository; the CVS
repo is just their for the old farts to get the latest stuff ;-P

Thanks!

Michael

PS
Please send me other opinions.

^ permalink raw reply	[flat|nested] 33+ messages in thread
* (unknown)
@ 2006-11-21 22:24 Johannes Schindelin
  2006-11-22 20:16 ` your mail Davide Libenzi
  0 siblings, 1 reply; 33+ messages in thread
From: Johannes Schindelin @ 2006-11-21 22:24 UTC (permalink / raw)
  To: Davide Libenzi, git

[PATCH] xdiff: add xdl_merge()

This new function implements the functionality of RCS merge, but
in-memory. It returns < 0 on error, otherwise the number of conflicts.

Finding the conflicting lines can be a very expensive task. You can
control the eagerness of this algorithm:

- a level value of 0 means that all overlapping changes are treated
  as conflicts,
- a value of 1 means that if the overlapping changes are identical,
  it is not treated as a conflict.
- If you set level to 2, overlapping changes will be analyzed, so that
  almost identical changes will not result in huge conflicts. Rather,
  only the conflicting lines will be shown inside conflict markers.

With each increasing level, the algorithm gets slower, but more accurate.
Note that the code for level 2 depends on the simple definition of
mmfile_t specific to git, and therefore it will be harder to port that
to LibXDiff.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	This code is only lightly tested, but I am tired and hungry.

	My hopes are that when I wake up in the morning, all bugs are
	fixed, git-merge-one-file is rewritten as a builtin,
	git-merge-index defaults to calling xdl_merge() directly when
	no program is passed with "-o", and git-merge-recursive also
	avoids fork()ing RCS' merge.

	A funny side effect is that you can merge with white space
	corruption by setting the xpparam flags to ignore whitespace.
	The file passed as mf1 wins over mf2 in that case.

	Oh, and maybe I did not need to use xdl_change_compact() (and
	thus could have left that static to xdiffi.c)? Davide, if you 
	could enlighten me, I will take the time next weekend to port this 
	to LibXDiff ;-)

	BTW if anybody wonders why these diffstats do not look correct:
	"git apply --stat" does not yet have our new scaling...

 Makefile       |    3 
 xdiff/xdiff.h  |    7 +
 xdiff/xdiffi.c |    3 
 xdiff/xdiffi.h |    1 
 xdiff/xmerge.c |  433 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 444 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 4c3f87f..b10d65e 100644
--- a/Makefile
+++ b/Makefile
@@ -769,7 +769,8 @@ $(DIFF_OBJS): diffcore.h
 $(LIB_FILE): $(LIB_OBJS)
 	rm -f $@ && $(AR) rcs $@ $(LIB_OBJS)
 
-XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o
+XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
+	xdiff/xmerge.o
 $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
 	xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
 
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index c9f8178..fa409d5 100644
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
@@ -49,6 +49,9 @@ extern "C" {
 #define XDL_BDOP_CPY 2
 #define XDL_BDOP_INSB 3
 
+#define XDL_MERGE_MINIMAL 0
+#define XDL_MERGE_EAGER 1
+#define XDL_MERGE_ZEALOUS 2
 
 typedef struct s_mmfile {
 	char *ptr;
@@ -90,6 +93,10 @@ long xdl_mmfile_size(mmfile_t *mmf);
 int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
 	     xdemitconf_t const *xecfg, xdemitcb_t *ecb);
 
+int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
+		mmfile_t *mf2, const char *name2,
+		xpparam_t const *xpp, int level, mmbuffer_t *result);
+
 #ifdef __cplusplus
 }
 #endif /* #ifdef __cplusplus */
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index d76e76a..9aeebc4 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -45,7 +45,6 @@ static long xdl_split(unsigned long cons
 		      long *kvdf, long *kvdb, int need_min, xdpsplit_t *spl,
 		      xdalgoenv_t *xenv);
 static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1, long chg2);
-static int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags);
 
 
 
@@ -397,7 +396,7 @@ static xdchange_t *xdl_add_change(xdchan
 }
 
 
-static int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
+int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
 	long ix, ixo, ixs, ixref, grpsiz, nrec = xdf->nrec;
 	char *rchg = xdf->rchg, *rchgo = xdfo->rchg;
 	xrecord_t **recs = xdf->recs;
diff --git a/xdiff/xdiffi.h b/xdiff/xdiffi.h
index d3b7271..472aeae 100644
--- a/xdiff/xdiffi.h
+++ b/xdiff/xdiffi.h
@@ -50,6 +50,7 @@ int xdl_recs_cmp(diffdata_t *dd1, long o
 		 long *kvdf, long *kvdb, int need_min, xdalgoenv_t *xenv);
 int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
 		xdfenv_t *xe);
+int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags);
 int xdl_build_script(xdfenv_t *xe, xdchange_t **xscr);
 void xdl_free_script(xdchange_t *xscr);
 int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c
new file mode 100644
index 0000000..7b85aa5
--- /dev/null
+++ b/xdiff/xmerge.c
@@ -0,0 +1,433 @@
+/*
+ *  LibXDiff by Davide Libenzi ( File Differential Library )
+ *  Copyright (C) 2003-2006 Davide Libenzi, Johannes E. Schindelin
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *  Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#include "xinclude.h"
+
+typedef struct s_xdmerge {
+	struct s_xdmerge *next;
+	/*
+	 * 0 = conflict,
+	 * 1 = no conflict, take first,
+	 * 2 = no conflict, take second.
+	 */
+	int mode;
+	long i1, i2;
+	long chg1, chg2;
+} xdmerge_t;
+
+static int xdl_append_merge(xdmerge_t **merge, int mode,
+		long i1, long chg1, long i2, long chg2)
+{
+	xdmerge_t *m = *merge;
+	if (m && mode == m->mode &&
+			(i1 == m->i1 + m->chg1 || i2 == m->i2 + m->chg2)) {
+		m->chg1 = i1 + chg1 - m->i1;
+		m->chg2 = i2 + chg2 - m->i2;
+	} else {
+		m = xdl_malloc(sizeof(xdmerge_t));
+		if (!m)
+			return -1;
+		m->next = NULL;
+		m->mode = mode;
+		m->i1 = i1;
+		m->chg1 = chg1;
+		m->i2 = i2;
+		m->chg2 = chg2;
+		if (*merge)
+			(*merge)->next = m;
+		*merge = m;
+	}
+	return 0;
+}
+
+static int xdl_cleanup_merge(xdmerge_t *c)
+{
+	int count = 0;
+	xdmerge_t *next_c;
+
+	/* were there conflicts? */
+	for (; c; c = next_c) {
+		if (c->mode == 0)
+			count++;
+		next_c = c->next;
+		free(c);
+	}
+	return count;
+}
+
+static int xdl_merge_cmp_lines(xdfenv_t *xe1, int i1, xdfenv_t *xe2, int i2,
+		int line_count, long flags)
+{
+	int i;
+	xrecord_t **rec1 = xe1->xdf2.recs + i1;
+	xrecord_t **rec2 = xe2->xdf2.recs + i2;
+
+	for (i = 0; i < line_count; i++) {
+		int result = xdl_recmatch(rec1[i]->ptr, rec1[i]->size,
+			rec2[i]->ptr, rec2[i]->size, flags);
+		if (!result)
+			return -1;
+	}
+	return 0;
+}
+
+static int xdl_recs_copy(xdfenv_t *xe, int i, int count, int add_nl, char *dest)
+{
+	xrecord_t **recs = xe->xdf2.recs + i;
+	int size = 0;
+
+	if (count < 1)
+		return 0;
+
+	for (i = 0; i < count; size += recs[i++]->size)
+		if (dest)
+			memcpy(dest + size, recs[i]->ptr, recs[i]->size);
+	if (add_nl) {
+		i = recs[count - 1]->size;
+		if (i == 0 || recs[count - 1]->ptr[i - 1] != '\n') {
+			if (dest)
+				dest[size] = '\n';
+			size++;
+		}
+	}
+	return size;
+}
+
+static int xdl_fill_merge_buffer(xdfenv_t *xe1, const char *name1,
+		xdfenv_t *xe2, const char *name2, xdmerge_t *m, char *dest)
+{
+	const int marker_size = 7;
+	int marker1_size = (name1 ? strlen(name1) + 1 : 0);
+	int marker2_size = (name2 ? strlen(name2) + 1 : 0);
+	int conflict_marker_size = 3 * (marker_size + 1)
+		+ marker1_size + marker2_size;
+	int size, i1, j;
+
+	for (size = i1 = 0; m; m = m->next) {
+		if (m->mode == 0) {
+			size += xdl_recs_copy(xe1, i1, m->i1 - i1, 0,
+					dest ? dest + size : NULL);
+			if (dest) {
+				for (j = 0; j < marker_size; j++)
+					dest[size++] = '<';
+				if (marker1_size) {
+					dest[size] = ' ';
+					memcpy(dest + size + 1, name1,
+							marker1_size - 1);
+					size += marker1_size;
+				}
+				dest[size++] = '\n';
+			} else
+				size += conflict_marker_size;
+			size += xdl_recs_copy(xe1, m->i1, m->chg1, 1,
+					dest ? dest + size : NULL);
+			if (dest) {
+				for (j = 0; j < marker_size; j++)
+					dest[size++] = '=';
+				dest[size++] = '\n';
+			}
+			size += xdl_recs_copy(xe2, m->i2, m->chg2, 1,
+					dest ? dest + size : NULL);
+			if (dest) {
+				for (j = 0; j < marker_size; j++)
+					dest[size++] = '>';
+				if (marker2_size) {
+					dest[size] = ' ';
+					memcpy(dest + size + 1, name2,
+							marker2_size - 1);
+					size += marker2_size;
+				}
+				dest[size++] = '\n';
+			}
+		} else if (m->mode == 1)
+			size += xdl_recs_copy(xe1, i1, m->i1 + m->chg1 - i1, 0,
+					dest ? dest + size : NULL);
+		else if (m->mode == 2)
+			size += xdl_recs_copy(xe2, m->i2 - m->i1 + i1,
+					m->i1 + m->chg2 - i1, 0,
+					dest ? dest + size : NULL);
+		i1 = m->i1 + m->chg1;
+	}
+	size += xdl_recs_copy(xe1, i1, xe1->xdf2.nrec - i1, 0,
+			dest ? dest + size : NULL);
+	return size;
+}
+
+/*
+ * Sometimes, changes are not quite identical, but differ in only a few
+ * lines. Try hard to show only these few lines as conflicting.
+ */
+static int xdl_refine_conflicts(xdfenv_t *xe1, xdfenv_t *xe2, xdmerge_t *m,
+		xpparam_t const *xpp)
+{
+	for (; m; m = m->next) {
+		mmfile_t t1, t2;
+		xdfenv_t xe;
+		xdchange_t *xscr, *x;
+		int i1 = m->i1, i2 = m->i2;
+
+		/* let's handle just the conflicts */
+		if (m->mode)
+			continue;
+
+		/*
+		 * This probably does not work outside git, since
+		 * we have a very simple mmfile structure.
+		 */
+		t1.ptr = (char *)xe1->xdf2.recs[m->i1]->ptr;
+		t1.size = xe1->xdf2.recs[m->i1 + m->chg1]->ptr
+			+ xe1->xdf2.recs[m->i1 + m->chg1]->size - t1.ptr;
+		t2.ptr = (char *)xe2->xdf2.recs[m->i1]->ptr;
+		t2.size = xe2->xdf2.recs[m->i1 + m->chg1]->ptr
+			+ xe2->xdf2.recs[m->i1 + m->chg1]->size - t2.ptr;
+		if (xdl_do_diff(&t1, &t2, xpp, &xe) < 0)
+			return -1;
+		if (xdl_change_compact(&xe.xdf1, &xe.xdf2, xpp->flags) < 0 ||
+		    xdl_change_compact(&xe.xdf2, &xe.xdf1, xpp->flags) < 0 ||
+		    xdl_build_script(&xe, &xscr) < 0) {
+			xdl_free_env(&xe);
+			return -1;
+		}
+		if (!xscr) {
+			/* If this happens, it's a bug. */
+			xdl_free_env(&xe);
+			return -2;
+		}
+		x = xscr;
+		m->i1 = xscr->i1 + i1;
+		m->chg1 = xscr->chg1;
+		m->i2 = xscr->i2 + i2;
+		m->chg2 = xscr->chg2;
+		while (xscr->next) {
+			xdmerge_t *m2 = xdl_malloc(sizeof(xdmerge_t));
+			if (!m2) {
+				xdl_free_env(&xe);
+				xdl_free_script(x);
+				return -1;
+			}
+			xscr = xscr->next;
+			m2->next = m->next;
+			m->next = m2;
+			m = m2;
+			m->mode = 0;
+			m->i1 = xscr->i1 + i1;
+			m->chg1 = xscr->chg1;
+			m->i2 = xscr->i2 + i2;
+			m->chg2 = xscr->chg2;
+		}
+		xdl_free_env(&xe);
+		xdl_free_script(x);
+	}
+	return 0;
+}
+
+/*
+ * level == 0: mark all overlapping changes as conflict
+ * level == 1: mark overlapping changes as conflict only if not identical
+ * level == 2: analyze non-identical changes for minimal conflict set
+ *
+ * returns < 0 on error, == 0 for no conflicts, else number of conflicts
+ */
+static int xdl_do_merge(xdfenv_t *xe1, xdchange_t *xscr1, const char *name1,
+		xdfenv_t *xe2, xdchange_t *xscr2, const char *name2,
+		int level, xpparam_t const *xpp, mmbuffer_t *result) {
+	xdmerge_t *changes, *c;
+	int i1, i2, chg1, chg2;
+
+	c = changes = NULL;
+
+	while (xscr1 && xscr2) {
+		if (!changes)
+			changes = c;
+		if (xscr1->i1 + xscr1->chg1 < xscr2->i1) {
+			i1 = xscr1->i2;
+			i2 = xscr2->i2 - xscr2->i1 + xscr1->i1;
+			chg1 = xscr1->chg2;
+			chg2 = xscr1->chg1;
+			if (xdl_append_merge(&c, 1, i1, chg1, i2, chg2)) {
+				xdl_cleanup_merge(changes);
+				return -1;
+			}
+			xscr1 = xscr1->next;
+			continue;
+		}
+		if (xscr2->i1 + xscr2->chg1 < xscr1->i1) {
+			i1 = xscr1->i2 - xscr1->i1 + xscr2->i1;
+			i2 = xscr2->i2;
+			chg1 = xscr2->chg1;
+			chg2 = xscr2->chg2;
+			if (xdl_append_merge(&c, 2, i1, chg1, i2, chg2)) {
+				xdl_cleanup_merge(changes);
+				return -1;
+			}
+			xscr2 = xscr2->next;
+			continue;
+		}
+		if (level < 1 || xscr1->i1 != xscr2->i1 ||
+				xscr1->chg1 != xscr2->chg1 ||
+				xscr1->chg2 != xscr2->chg2 ||
+				xdl_merge_cmp_lines(xe1, xscr1->i2,
+					xe2, xscr2->i2,
+					xscr1->chg2, xpp->flags)) {
+			/* conflict */
+			int off = xscr1->i1 - xscr2->i1;
+			int ffo = off + xscr1->chg1 - xscr2->chg1;
+
+			i1 = xscr1->i2;
+			i2 = xscr2->i2;
+			if (off > 0)
+				i1 -= off;
+			else
+				i2 += off;
+			chg1 = xscr1->i2 + xscr1->chg2 - i1;
+			chg2 = xscr2->i2 + xscr2->chg2 - i2;
+			if (ffo > 0)
+				chg2 += ffo;
+			else
+				chg1 -= ffo;
+			if (xdl_append_merge(&c, 0, i1, chg1, i2, chg2)) {
+				xdl_cleanup_merge(changes);
+				return -1;
+			}
+		}
+
+		i1 = xscr1->i1 + xscr1->chg1;
+		i2 = xscr2->i1 + xscr2->chg1;
+
+		if (i1 > i2) {
+			xscr1->chg1 -= i1 - i2;
+			xscr1->i1 = i2;
+			xscr1->i2 += xscr1->chg2;
+			xscr1->chg2 = 0;
+			xscr1 = xscr1->next;
+		} else if (i2 > i1) {
+			xscr2->chg1 -= i2 - i1;
+			xscr2->i1 = i1;
+			xscr2->i2 += xscr2->chg2;
+			xscr2->chg2 = 0;
+			xscr2 = xscr2->next;
+		} else {
+			xscr1 = xscr1->next;
+			xscr2 = xscr2->next;
+		}
+	}
+	while (xscr1) {
+		if (!changes)
+			changes = c;
+		i1 = xscr1->i2;
+		i2 = xscr1->i1 + xe2->xdf2.nrec - xe2->xdf1.nrec;
+		chg1 = xscr1->chg2;
+		chg2 = xscr1->chg1;
+		if (xdl_append_merge(&c, 1, i1, chg1, i2, chg2)) {
+			xdl_cleanup_merge(changes);
+			return -1;
+		}
+		xscr1 = xscr1->next;
+	}
+	while (xscr2) {
+		if (!changes)
+			changes = c;
+		i1 = xscr2->i1 + xe1->xdf2.nrec - xe1->xdf1.nrec;
+		i2 = xscr2->i2;
+		chg1 = xscr2->chg1;
+		chg2 = xscr2->chg2;
+		if (xdl_append_merge(&c, 2, i1, chg1, i2, chg2)) {
+			xdl_cleanup_merge(changes);
+			return -1;
+		}
+		xscr2 = xscr2->next;
+	}
+	if (!changes)
+		changes = c;
+	/* refine conflicts */
+	if (level > 1 && xdl_refine_conflicts(xe1, xe2, changes, xpp) < 0) {
+		xdl_cleanup_merge(changes);
+		return -1;
+	}
+	/* output */
+	if (result) {
+		int size = xdl_fill_merge_buffer(xe1, name1, xe2, name2,
+			changes, NULL);
+		result->ptr = xdl_malloc(size);
+		if (!result->ptr) {
+			xdl_cleanup_merge(changes);
+			return -1;
+		}
+		result->size = size;
+		xdl_fill_merge_buffer(xe1, name1, xe2, name2, changes,
+				result->ptr);
+	}
+	return xdl_cleanup_merge(changes);
+}
+
+int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
+		mmfile_t *mf2, const char *name2,
+		xpparam_t const *xpp, int level, mmbuffer_t *result) {
+	xdchange_t *xscr1, *xscr2;
+	xdfenv_t xe1, xe2;
+
+	result->ptr = NULL;
+	result->size = 0;
+
+	if (xdl_do_diff(orig, mf1, xpp, &xe1) < 0 ||
+			xdl_do_diff(orig, mf2, xpp, &xe2) < 0) {
+		return -1;
+	}
+	if (xdl_change_compact(&xe1.xdf1, &xe1.xdf2, xpp->flags) < 0 ||
+	    xdl_change_compact(&xe1.xdf2, &xe1.xdf1, xpp->flags) < 0 ||
+	    xdl_build_script(&xe1, &xscr1) < 0) {
+		xdl_free_env(&xe1);
+		return -1;
+	}
+	if (xdl_change_compact(&xe2.xdf1, &xe2.xdf2, xpp->flags) < 0 ||
+	    xdl_change_compact(&xe2.xdf2, &xe2.xdf1, xpp->flags) < 0 ||
+	    xdl_build_script(&xe2, &xscr2) < 0) {
+		xdl_free_env(&xe2);
+		return -1;
+	}
+	if (xscr1 || xscr2) {
+		if (!xscr1) {
+			result->ptr = xdl_malloc(mf2->size);
+			memcpy(result->ptr, mf2->ptr, mf2->size);
+			result->size = mf2->size;
+		} else if (!xscr2) {
+			result->ptr = xdl_malloc(mf1->size);
+			memcpy(result->ptr, mf1->ptr, mf1->size);
+			result->size = mf1->size;
+		} else if (xdl_do_merge(&xe1, xscr1, name1,
+					&xe2, xscr2, name2,
+					level, xpp, result) < 0) {
+			xdl_free_script(xscr1);
+			xdl_free_script(xscr2);
+			xdl_free_env(&xe1);
+			xdl_free_env(&xe2);
+			return -1;
+		}
+		xdl_free_script(xscr1);
+		xdl_free_script(xscr2);
+	}
+	xdl_free_env(&xe1);
+	xdl_free_env(&xe2);
+
+	return 0;
+}

^ permalink raw reply related	[flat|nested] 33+ messages in thread
* (unknown)
@ 2006-10-20 14:24 andyparkins
  2006-10-20 14:42 ` your mail Johannes Schindelin
  0 siblings, 1 reply; 33+ messages in thread
From: andyparkins @ 2006-10-20 14:24 UTC (permalink / raw)


>From 9c128bc4b9b85385b7b98ceae0c89283d70e5d45 Mon Sep 17 00:00:00 2001
From: Andy Parkins <andyparkins@gmail.com>
Date: Fri, 20 Oct 2006 15:24:22 +0100
Subject: [PATCH] Remove git-send-email references from documentation
MIME-Version: 1.0
X-TUID: 1fbae8e75caaf795
X-Length: 1933
To: git@vger.kernel.org
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_WwNOFc8Re2ORHlu"
Message-Id: <200610201524.22493.andyparkins@gmail.com>

This is a multi-part message in MIME format.
--Boundary-00=_WwNOFc8Re2ORHlu
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


git-send-email doesn't exist; so don't refer to it in the documentation.

Perhaps git-send-email.perl is meant to do this job?  It runs with an error.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 Documentation/git-format-patch.txt |    2 +-
 Documentation/git.txt              |    3 ---
 2 files changed, 1 insertions(+), 4 deletions(-)

--Boundary-00=_WwNOFc8Re2ORHlu
Content-Type: text/x-patch;
  name="9c128bc4b9b85385b7b98ceae0c89283d70e5d45.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
 filename="9c128bc4b9b85385b7b98ceae0c89283d70e5d45.diff"

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 67425dc..9257030 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -112,7 +112,7 @@ git-format-patch -M -B origin::
 
 See Also
 --------
-gitlink:git-am[1], gitlink:git-send-email[1]
+gitlink:git-am[1]
 
 
 Author
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 3af6fc6..1f60d3f 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -478,9 +478,6 @@ gitlink:git-request-pull[1]::
 gitlink:git-rev-parse[1]::
 	Pick out and massage parameters.
 
-gitlink:git-send-email[1]::
-	Send patch e-mails out of "format-patch --mbox" output.
-
 gitlink:git-symbolic-ref[1]::
 	Read and modify symbolic refs.
 

--Boundary-00=_WwNOFc8Re2ORHlu--

^ permalink raw reply related	[flat|nested] 33+ messages in thread
[parent not found: <C8DBC54F2A9BAD4FA7F445CC7ADD963B0232474F@sslmexchange1.paymentech.us>]
* (unknown)
@ 2006-05-21 23:53 J. Bruce Fields
  2006-05-21 23:55 ` your mail J. Bruce Fields
  0 siblings, 1 reply; 33+ messages in thread
From: J. Bruce Fields @ 2006-05-21 23:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

>From nobody Mon Sep 17 00:00:00 2001
From: J. Bruce Fields <bfields@citi.umich.edu>
Date: Sun, 21 May 2006 16:52:34 -0400
Subject: [PATCH 1/3] tutorial: replace "whatchanged" by "log"

Junio suggested changing references to git-whatchanged to git-log.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

---

d1177b299b449e9eb63d963ee118a5e0283aa611
 Documentation/tutorial.txt |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

d1177b299b449e9eb63d963ee118a5e0283aa611
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index fa79b01..cd0f0df 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -80,13 +80,13 @@ file; just remove it, then commit.
 At any point you can view the history of your changes using
 
 ------------------------------------------------
-$ git whatchanged
+$ git log
 ------------------------------------------------
 
 If you also want to see complete diffs at each step, use
 
 ------------------------------------------------
-$ git whatchanged -p
+$ git log -p
 ------------------------------------------------
 
 Managing branches
@@ -216,7 +216,7 @@ This actually pulls changes from the bra
 "master".  Alice could request a different branch by adding the name
 of the branch to the end of the git pull command line.
 
-This merges Bob's changes into her repository; "git whatchanged" will
+This merges Bob's changes into her repository; "git log" will
 now show the new commits.  If Alice has made her own changes in the
 meantime, then Bob's changes will be merged in, and she will need to
 manually fix any conflicts.
@@ -234,7 +234,7 @@ named bob-incoming.  (Unlike git pull, g
 of Bob's line of development without doing any merging).  Then
 
 -------------------------------------
-$ git whatchanged -p master..bob-incoming
+$ git log -p master..bob-incoming
 -------------------------------------
 
 shows a list of all the changes that Bob made since he branched from
@@ -330,13 +330,13 @@ But you may find it more useful to see t
 the experimental branch but not in the current branch, and
 
 -------------------------------------
-git whatchanged HEAD..experimental
+git log HEAD..experimental
 -------------------------------------
 
 will do that, just as
 
 -------------------------------------
-git whatchanged experimental..HEAD
+git log experimental..HEAD
 -------------------------------------
 
 will show the list of commits made on the HEAD but not included in
-- 
1.3.3.gff62

^ permalink raw reply related	[flat|nested] 33+ messages in thread
* (unknown), 
@ 2005-10-05  6:10 Willem Swart
  2005-10-06 10:52 ` your mail Elfyn McBratney
  0 siblings, 1 reply; 33+ messages in thread
From: Willem Swart @ 2005-10-05  6:10 UTC (permalink / raw)
  To: git

subscribe git

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2020-06-24  1:31 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22  9:50 Jessie Hernandez
2017-06-22 12:48 ` your mail Simon Ruderich
2017-06-22 13:35   ` AW: " Patrick Lehmann
2017-06-22 13:47     ` Simon Ruderich
2017-06-22 13:55       ` AW: " Patrick Lehmann
2017-06-22 20:46         ` Simon Ruderich
2017-06-22 21:35           ` Junio C Hamano
2017-06-22 21:58             ` Ævar Arnfjörð Bjarmason
2017-06-22 22:14               ` Junio C Hamano
2017-06-22 23:21               ` Jeff King
2017-06-23  5:23                 ` Junio C Hamano
2017-06-23 16:53                   ` Jeff King
2017-06-23 18:44                     ` Junio C Hamano
2017-06-23  6:58               ` demerphq
  -- strict thread matches above, loose matches on Subject: below --
2020-06-24  0:38 shejan shuza
2020-06-24  1:31 ` your mail brian m. carlson
2019-11-20  3:49 Han-Wen Nienhuys
2019-11-20  5:30 ` your mail Taylor Blau
2019-11-20  8:05   ` Christian Couder
2019-07-11 20:11 Robert Morgan
2019-07-11 20:18 ` your mail Kevin Daudt
2019-07-11 20:25   ` Robert Morgan
2019-01-25  9:47 Furkan DURUL
2019-01-25 11:27 ` your mail Kevin Daudt
2016-04-11 19:04 (unknown), miwilliams
2016-04-11 19:13 ` your mail Jeff King
2013-05-17 18:02 (unknown), ASHISH VERMA
2013-05-21 13:13 ` your mail Magnus Bäck
2012-05-06 14:17 (unknown), Bruce Zu
2012-05-06 17:04 ` your mail Marcus Karlsson
2008-08-13 14:54 (unknown), aneesh.kumar
2008-08-13 15:16 ` your mail Aneesh Kumar K.V
2007-12-05 19:00 [PATCH 0/6] builtin-remote Johannes Schindelin
2007-12-05 19:00 ` (unknown) Johannes Schindelin
2007-12-05 19:01   ` your mail Johannes Schindelin
2007-10-13  4:01 (unknown), Michael Witten
2007-10-13  4:07 ` your mail Jeff King
2006-11-21 22:24 (unknown) Johannes Schindelin
2006-11-22 20:16 ` your mail Davide Libenzi
2006-10-20 14:24 (unknown) andyparkins
2006-10-20 14:42 ` your mail Johannes Schindelin
     [not found] <C8DBC54F2A9BAD4FA7F445CC7ADD963B0232474F@sslmexchange1.paymentech.us>
2006-09-26 19:56 ` Linus Torvalds
2006-05-21 23:53 (unknown) J. Bruce Fields
2006-05-21 23:55 ` your mail J. Bruce Fields
2006-05-22  0:16   ` Junio C Hamano
2006-05-22  1:33     ` J. Bruce Fields
2005-10-05  6:10 (unknown), Willem Swart
2005-10-06 10:52 ` your mail Elfyn McBratney

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).