Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is not possible to stop git processing before a pull request and take a user input. I mean, it is possible, but for that you will have to make a few changes to git and build it from source. I am not going down this path.</p> <p>There is a nifty little trick to use conditional statements within <em>git hooks</em>. You can use Ruby (or any other language) within a git hook to make it conditional. This works best in a <code>pre-commit</code> hook or a hook that is invoked before any actual processing happens. In case of a <code>git pull</code>, the only hook you can latch on to is the <code>post-merge</code> hook and that too is invoked only after the entire processing is done. So, there is no point really asking the user if they want to merge another branch after the branch is merged, right :) However, you can show them a message.</p> <p>For this, use something like:</p> <pre><code>#!/usr/bin/env ruby branch=$(git rev-parse --symbolic --abbrev-ref $1) if branch != $GIT_DIR/ORIG_HEAD puts "You merged a different branch dim wit" end </code></pre> <p>Now, what I am trying to do is compare if the merged branch was the same as the original branch name and if not, show the user a message. This will appear as <code>remote</code> on your git merge summary.</p> <p>Again, am not sure if this will work, cause I am not really sure if <code>git rev-parse --symbolic --abbrev-ref $1</code> will give you the branch name.</p> <p>This is again, just a suggestion, not a solution to your question :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload