Merge driver not called for locally modified files?

2016-04-02 Thread Gioele Barabucci
Hello,

it seems to me that merge drivers are not called while merging commits
that touch locally modified (but uncommited) files. Is this correct?

I made a (simple) merge driver for files in the `pw` format. [1] This
driver works correctly when a file is modified by multiple commits.
However, if a file has only been modified locally (and not committed),
then merging a commit that modifies the same file raises the following
error:

$ git merge --ff-only 78d4f09
Updating 5180202..78d4f09
error: Your local changes to the following files would
be overwritten by merge:
.local/share/pw/passwords
Please, commit your changes or stash them before you can merge.
Aborting

>From my experiments, it looks like the merge driver is not called at all.

Is it possible to configure git so that the merge driver is called also
while merging locally modified files?

Regards,

[1] https://github.com/gioele/pw/blob/master/bin/git-pw-merge

-- 
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Request: git stash create --include-untracked

2015-11-12 Thread Gioele Barabucci

Hello,

`git stash create` does not accepts the same options that `git stash 
save` accepts.


It would be handy to have `git stash create` accept 
`-u`/`--include-untracked` and `-a`/`--all`. This would allow a very 
simple "freeze-the-world-I-have-to-leave emergency backup" command such as


git push -f origin $(git stash create 
-u):refs/heads/emergency/$USER-$(date +%s)


(Derived from <https://lwn.net/Articles/664137/> by user nybble41; 
useful for <http://stackoverflow.com/q/10226586/449288>.)


Regards,

--
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git clone does not understand insteadOf URLs

2013-05-26 Thread Gioele Barabucci

Il 26/05/2013 21:00, John Keeping ha scritto:

Regardless of the implementation of the commands, if I do

  mkdir projectA
  cd projectA
  git init .
  git remote add origin remote-repo/projectA.git
  git pull origin master

I get a working repository. If I do

  git clone remote-repo/projectA.git

all I will get is an error.


So the problem is that "git clone" does not seem to perform normal
remote processing if you give it something that looks like a path.


I understand the problem. In the original email that started this thread 
I asked for...



I suppose that git interprets the argument as a local directory. Git
should see if the argument matches one of the known URLs before
raising an error.


I think all the paths should mean the same in every git command. In this 
case, checking for insteadOf URLs before failing would solve this problem.


Regards,

--
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git clone does not understand insteadOf URLs

2013-05-26 Thread Gioele Barabucci

Il 26/05/2013 20:14, John Keeping ha scritto:

On Sun, May 26, 2013 at 08:09:56PM +0200, Gioele Barabucci wrote:

Il 26/05/2013 20:00, Andreas Schwab ha scritto:

Simple, I keep all my projects on the same server, so I would like to
refer to that server + path using 'remote-repo'.

"git+ssh://git.example.org//users/gioele/projects" insteadOf "remote-repo"


In what way do you think that `git remote add` handles the path?

All `git remote add` does is add a new "remote..url" entry to the
configuration file with the value as given on the command line.  The
insteadOf mapping will only be applied when you try to fetch from/push
to the remote.


Regardless of the implementation of the commands, if I do

mkdir projectA
cd projectA
git init .
git remote add origin remote-repo/projectA.git
git pull origin master

I get a working repository. If I do

git clone remote-repo/projectA.git

all I will get is an error.

I do not see any reason (UX-wise) why the two sequences of commands 
shouldn't work the same when used on the same URL.


Regards,

--
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git clone does not understand insteadOf URLs

2013-05-26 Thread Gioele Barabucci

Il 26/05/2013 20:00, Andreas Schwab ha scritto:

Simple, I keep all my projects on the same server, so I would like to
refer to that server + path using 'remote-repo'.

"git+ssh://git.example.org//users/gioele/projects" insteadOf "remote-repo"


You can use "remote-repo:" instead.


Do you mean I could use 
"git+ssh://git.example.org//users/gioele/projects" insteadOf 
"remote-repo:"? Yes, but now I have dozens of repositories already set 
up in various workstations and I do not want to go and change all of them.


What really bugs me is the fact that `git clone` and `git remote add` 
parse the same path in different ways. Git already has many 
inconsistencies. This one can be easily ironed out.


Regards,

--
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git clone does not understand insteadOf URLs

2013-05-26 Thread Gioele Barabucci

Il 26/05/2013 17:13, Elia Pinto ha scritto:
>>   $ git clone remote-repo/ProjectA.git
>>   fatal repository 'remote-repo/ProjectA.git' does not exist
>

Why someone should be do something like this ? What is the use case ?


Simple, I keep all my projects on the same server, so I would like to 
refer to that server + path using 'remote-repo'.


"git+ssh://git.example.org//users/gioele/projects" insteadOf "remote-repo"

I also helps me when I move all the projects from one path to another in 
the remote server: I only need to change the path once in `~/.gitconfig`.


Please note that `git remote add` correctly understands 
'remote-repo/ProjectA.git'. I was expecting that `clone` and `remote` 
both used the same code to parse paths.


Regards,

--
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


git clone does not understand insteadOf URLs

2013-05-25 Thread Gioele Barabucci

Hello,

it seems that `git clone` does not understand keywords used `insteadOf` 
longer URLs.


$ git clone remote-repo/ProjectA.git
fatal repository 'remote-repo/ProjectA.git' does not exist

I suppose that git interprets the argument as a local directory. Git 
should see if the argument matches one of the known URLs before raising 
an error.


Regards,

--
Gioele Barabucci 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html